CREATE TABLE users (
id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE privileges (
id INT NOT NULL AUTO_INCREMENT,
privilege VARCHAR(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE user_privileges (
user_id INT NOT NULL,
privilege_id INT NOT NULL,
PRIMARY KEY (user_id, privilege_id),
FOREIGN KEY (user_id) REFERENCES users(id),
FOREIGN KEY (privilege_id) REFERENCES privileges(id)
);