4
DROP TABLE group_members;
9
login varchar(80) PRIMARY KEY, -- login id
14
grpnm varchar(18) PRIMARY KEY, -- group name Y^4-S^9-G^3
15
nick varchar(80), -- group nickname
16
subject varchar(9), -- subject code
17
year varchar(4) -- when
20
CREATE TABLE group_members (
21
login varchar(80) REFERENCES users (login),
22
grpnm varchar(18) REFERENCES groups (grpnm)
25
CREATE TABLE enrolment (
26
login varchar(80) REFERENCES users (login),
32
login varchar(80) REFERENCES users (login),
36
INSERT INTO users (login,nick) values ('conway', 'Tom');
37
INSERT INTO users (login,nick) values ('apeel', 'Andrew');
38
INSERT INTO users (login,nick) values ('mgiuca', 'Matt');
39
INSERT INTO users (login,nick) values ('sb', 'Steven');
40
INSERT INTO users (login,nick) values ('mpp', 'Mike');
41
INSERT INTO users (login,nick) values ('ivo', 'Ivo');
43
INSERT INTO groups (grpnm, nick, subject, year) values ('2007-INFO10001-321', 'Purple Alert', 'INFO10001', '2008');
44
INSERT INTO groups (grpnm, nick, subject, year) values ('2007-INFO10001-322', 'Blind Illuminati', 'INFO10001', '2008');
46
INSERT INTO group_members (login,grpnm) values ('conway', '2007-INFO10001-321');
47
INSERT INTO group_members (login,grpnm) values ('apeel', '2007-INFO10001-321');
48
INSERT INTO group_members (login,grpnm) values ('mgiuca', '2007-INFO10001-321');
49
INSERT INTO group_members (login,grpnm) values ('sb', '2007-INFO10001-321');
50
INSERT INTO group_members (login,grpnm) values ('mpp', '2007-INFO10001-322');
51
INSERT INTO group_members (login,grpnm) values ('ivo', '2007-INFO10001-322');
53
INSERT INTO enrolment (login,subject,year) values ('conway' , 'INFO10001', '2008');
54
INSERT INTO enrolment (login,subject,year) values ('apeel' , 'INFO10001', '2008');
55
INSERT INTO enrolment (login,subject,year) values ('mgiuca' , 'INFO10001', '2008');
56
INSERT INTO enrolment (login,subject,year) values ('sb' , 'INFO10001', '2008');
57
INSERT INTO enrolment (login,subject,year) values ('mpp' , 'INFO10001', '2008');
58
INSERT INTO enrolment (login,subject,year) values ('ivo' , 'INFO10001', '2008');