-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.sql
46 lines (40 loc) · 1 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
create table admin
(
userId varchar(255) PRIMARY KEY,
name varchar(255),
passw varchar(255)
);
create table student
(
userId varchar(255) PRIMARY KEY,
name varchar(255),
joining_year varchar(255),
Branch varchar(255),
passw varchar(255)
);
create table course
(
course_id varchar(255) PRIMARY KEY,
coursename varchar(255) UNIQUE,
type varchar(255),
credits INT
);
create table availableCourses
(
course_id varchar(255),
semester INT,
branch varchar(255) NOT NULL,
availableSeats INT,
totalSeats INT,
grp varchar(255),
FOREIGN KEY (course_id) REFERENCES course (course_id),
PRIMARY KEY (course_id, semester, branch)
);
create table courseEnrollment
(
course_id varchar(255),
student_id varchar(255),
FOREIGN KEY (student_id) REFERENCES student (userId),
FOREIGN KEY (course_id) REFERENCES course (course_id),
PRIMARY KEY (course_id, student_id)
);