-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcreateTable.txt
More file actions
8 lines (4 loc) · 846 Bytes
/
createTable.txt
File metadata and controls
8 lines (4 loc) · 846 Bytes
1
2
3
4
5
6
7
CREATE TABLE user(uid INT NOT NULL AUTO_INCREMENT, username VARCHAR(255) NOT NULL, groupid INT NOT NULL, password VARCHAR(255) NOT NULL, PRIMARY KEY(uid));
CREATE TABLE dataset(ds_id INT NOT NULL AUTO_INCREMENT, uid INT NOT NULL, ds_name VARCHAR(255) NOT NULL, path VARCHAR(255) NOT NULL, PRIMARY KEY(ds_id), FOREIGN KEY(uid) REFERENCES user(uid));
CREATE TABLE query(qid INT NOT NULL AUTO_INCREMENT, content VARCHAR(255) NOT NULL, uid INT NOT NULL, ds_id INT NOT NULL, PRIMARY KEY(qid), FOREIGN KEY(uid) REFERENCES user(uid), FOREIGN KEY(ds_id) REFERENCES dataset(ds_id));
CREATE TABLE annotation(aid INT NOT NULL AUTO_INCREMENT, uid INT NOT NULL, ds_id INT NOT NULL, qid INT NOT NULL, did INT NOT NULL, judgement VARCHAR(255) NOT NULL, PRIMARY KEY(aid), FOREIGN KEY(uid) REFERENCES user(uid), FOREIGN KEY(ds_id) REFERENCES dataset(ds_id));