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');
42
INSERT INTO groups (grpnm, nick, subject, year) values ('2007-INFO10001-321', 'Purple Alert', 'INFO10001', '2008');
44
INSERT INTO group_members (login,grpnm) values ('conway', '2007-INFO10001-321');
45
INSERT INTO group_members (login,grpnm) values ('apeel', '2007-INFO10001-321');
46
INSERT INTO group_members (login,grpnm) values ('mgiuca', '2007-INFO10001-321');
48
INSERT INTO enrolment (login,subject,year) values ('conway' , 'INFO10001', '2008');
49
INSERT INTO enrolment (login,subject,year) values ('apeel' , 'INFO10001', '2008');
50
INSERT INTO enrolment (login,subject,year) values ('mgiuca' , 'INFO10001', '2008');