-
Notifications
You must be signed in to change notification settings - Fork 1
/
Schema.sql
180 lines (154 loc) · 3.57 KB
/
Schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
CREATE TABLE AREAS (
PersonID mediumint NOT NULL,
TheseNo mediumint NOT NULL,
Area varchar(25) NOT NULL,
PRIMARY KEY (PersonID,TheseNo,Area)
);
CREATE TABLE ASSIST_PROF (
PersonID mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (PersonID)
);
CREATE TABLE ASSISTS (
SectionID mediumint NOT NULL AUTO_INCREMENT,
AssistID mediumint NOT NULL,
PRIMARY KEY (SectionID,AssistID)
);
CREATE TABLE ASSOC_PROF (
PersonID mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (PersonID)
);
CREATE TABLE COLLEGE (
CName varchar(60) NOT NULL,
CPhone varchar(10),
COffice tinytext,
DeanID mediumint,
PRIMARY KEY (CName)
);
CREATE TABLE COURSE (
CoCode mediumint NOT NULL AUTO_INCREMENT,
CoName tinytext,
CoDesc tinytext,
Credits tinyint,
Level tinyint,
CurrCode mediumint,
CoType tinyint,
PRIMARY KEY (CoCode)
);
CREATE TABLE TAKES (
PersonID mediumint NOT NULL AUTO_INCREMENT,
SectionID mediumint NOT NULL,
SecPoint tinyint,
PRIMARY KEY (PersonID,SectionID)
);
CREATE TABLE CURRICULUM (
CurrCode mediumint NOT NULL AUTO_INCREMENT,
Validity year,
EdType tinyint(1),
EdLang varchar(5),
DCode mediumint,
PRIMARY KEY (CurrCode)
);
CREATE TABLE DEPARTMENT (
DCode mediumint NOT NULL AUTO_INCREMENT,
DName tinytext,
DOffice tinytext,
DPhone varchar(10),
DArea tinyint,
CName varchar(60),
ChairID mediumint,
CStartDate date,
PRIMARY KEY (DCode)
);
CREATE TABLE DEPT_MAJOR (
MajorCode tinyint NOT NULL AUTO_INCREMENT,
MajorName varchar(40),
PRIMARY KEY (MajorCode)
);
CREATE TABLE FAC_MEMBER (
PersonID mediumint NOT NULL AUTO_INCREMENT,
DCode mediumint,
LecType tinyint,
PRIMARY KEY (PersonID)
);
CREATE TABLE INSTRUCTOR (
InstID mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (InstID)
);
CREATE TABLE SUBJECTS (
CoCode mediumint NOT NULL AUTO_INCREMENT,
Subject varchar(25) NOT NULL,
PRIMARY KEY (CoCode,Subject)
);
CREATE TABLE LABORATORY (
SectionID mediumint NOT NULL AUTO_INCREMENT,
LWeekDays binary(5),
LBuilding tinytext,
LRoomNo tinyint,
PRIMARY KEY (SectionID)
);
CREATE TABLE MANDATORY (
CoCode mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (CoCode)
);
CREATE TABLE N_TECHNICAL (
CoCode mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (CoCode)
);
CREATE TABLE OPTIONAL (
CoCode mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (CoCode)
);
CREATE TABLE PERSON (
PersonID mediumint NOT NULL AUTO_INCREMENT,
Fname varchar(20),
Mname varchar(20),
Lname varchar(20),
Phone varchar(10),
Address tinytext,
PRIMARY KEY (PersonID)
);
CREATE TABLE PROFFESOR (
PersonID mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (PersonID)
);
CREATE TABLE RES_ASSIST (
PersonID mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (PersonID)
);
CREATE TABLE SECTION (
SectionID mediumint NOT NULL AUTO_INCREMENT,
Semester tinyint(1),
SecYear year,
CoCode mediumint,
PRIMARY KEY (SectionID)
);
CREATE TABLE STUDENT (
PersonID mediumint NOT NULL AUTO_INCREMENT,
DOB date,
DCode mediumint,
PRIMARY KEY (PersonID)
);
CREATE TABLE STUDIES (
PersonID mediumint NOT NULL AUTO_INCREMENT,
TheseNo mediumint NOT NULL,
TheseName tinytext,
TheseType tinytext,
PubYear year,
PRIMARY KEY (PersonID,TheseNo)
);
CREATE TABLE TEACHES (
SectionID mediumint NOT NULL AUTO_INCREMENT,
InstID mediumint NOT NULL,
PRIMARY KEY (SectionID,InstID)
);
CREATE TABLE TECHNICAL (
CoCode mediumint NOT NULL AUTO_INCREMENT,
PRIMARY KEY (CoCode)
);
CREATE TABLE THEORETICAL (
SectionID mediumint NOT NULL AUTO_INCREMENT,
TWeekDays binary(5),
TBuilding tinytext,
TRoomNo tinyint,
PRIMARY KEY (SectionID)
);