1
-- We need a users database to do authorization, manage groups, &c
6
DROP TABLE group_members;
11
login varchar(80) PRIMARY KEY, -- login id
16
grpnm varchar(18) PRIMARY KEY, -- group name Y^4-S^9-G^3
17
nick varchar(80), -- group nickname
18
subject varchar(9), -- subject code
19
year varchar(4) -- when
22
CREATE TABLE group_members (
23
login varchar(80) REFERENCES users (login),
24
grpnm varchar(18) REFERENCES groups (grpnm)
27
CREATE TABLE enrolment (
28
login varchar(80) REFERENCES users (login),
34
login varchar(80) REFERENCES users (login),
38
INSERT INTO users (login,nick) values ('conway', 'Tom');
39
INSERT INTO users (login,nick) values ('apeel', 'Andrew');
40
INSERT INTO users (login,nick) values ('mgiuca', 'Matt');
41
INSERT INTO users (login,nick) values ('sb', 'Steven');
42
INSERT INTO users (login,nick) values ('mpp', 'Mike');
43
INSERT INTO users (login,nick) values ('ivo', 'Ivo');
45
INSERT INTO groups (grpnm, nick, subject, year) values ('2007-INFO10001-321', 'Purple Alert', 'INFO10001', '2008');
46
INSERT INTO groups (grpnm, nick, subject, year) values ('2007-INFO10001-322', 'Blind Illuminati', 'INFO10001', '2008');
48
INSERT INTO group_members (login,grpnm) values ('conway', '2007-INFO10001-321');
49
INSERT INTO group_members (login,grpnm) values ('apeel', '2007-INFO10001-321');
50
INSERT INTO group_members (login,grpnm) values ('mgiuca', '2007-INFO10001-321');
51
INSERT INTO group_members (login,grpnm) values ('sb', '2007-INFO10001-321');
52
INSERT INTO group_members (login,grpnm) values ('mpp', '2007-INFO10001-322');
53
INSERT INTO group_members (login,grpnm) values ('ivo', '2007-INFO10001-322');
55
INSERT INTO enrolment (login,subject,year) values ('conway' , 'INFO10001', '2008');
56
INSERT INTO enrolment (login,subject,year) values ('apeel' , 'INFO10001', '2008');
57
INSERT INTO enrolment (login,subject,year) values ('mgiuca' , 'INFO10001', '2008');
58
INSERT INTO enrolment (login,subject,year) values ('sb' , 'INFO10001', '2008');
59
INSERT INTO enrolment (login,subject,year) values ('mpp' , 'INFO10001', '2008');
60
INSERT INTO enrolment (login,subject,year) values ('ivo' , 'INFO10001', '2008');