-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabaseSetup.sql
More file actions
96 lines (88 loc) · 2.35 KB
/
databaseSetup.sql
File metadata and controls
96 lines (88 loc) · 2.35 KB
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
drop table if exists javabase.Users;
create table javabase.Users
(
id int NOT NULL auto_increment,
legalName VARCHAR(100) NOT NULL,
displayName VARCHAR(100) NULL,
email VARCHAR(100) NOT NULL,
universityId int not null,
isStudent bool not null,
PRIMARY KEY (id)
);
drop table if exists javabase.Student;
# create table javabase.Student
# (
# id int NOT NULL auto_increment,
# legalName VARCHAR(100) NOT NULL,
# displayName VARCHAR(100) NOT NULL,
# email VARCHAR(100) NOT NULL,
# universityId int not null,
# PRIMARY KEY (id)
# ) auto_increment=1;
#
drop table if exists javabase.Professor;
# create table javabase.Professor
# (
# id int NOT NULL auto_increment,
# name VARCHAR(100) NOT NULL,
# email VARCHAR(100) NOT NULL,
# universityId int not null,
# PRIMARY KEY (id)
# ) auto_increment=2;
drop table if exists javabase.Course;
create table javabase.Course
(
id int NOT NULL auto_increment,
name varchar(100) not null,
universityId int NOT NULL,
primary key (id)
);
drop table if exists javabase.Section;
create table javabase.Section
(
id int NOT NULL auto_increment,
courseId int NOT NULL,
instructorId int,
name varchar(100) not null,
primary key (id)
);
drop table if exists javabase.Lecture;
create table javabase.Lecture
(
id int NOT NULL auto_increment,
sectionId int NOT NULL,
date date not null,
primary key (id)
);
drop table if exists javabase.Enrollment;
create table javabase.Enrollment
(
sectionId int NOT NULL,
studentId int NOT NULL,
notify bool not null,
primary key (sectionId, studentId)
);
drop table if exists javabase.Attendance;
create table javabase.Attendance
(
lectureId int NOT NULL,
studentId int NOT NULL,
status varchar(10) not null,
primary key (lectureId, studentId)
);
drop table if exists javabase.Passwords;
create table javabase.Passwords
(
id int NOT NULL,
password varchar(100) not null,
isStudent bool not null,
primary key (id)
);
drop table if exists javabase.University;
create table javabase.University
(
id int NOT NULL auto_increment,
name varchar(100) not null,
changeName bool not null,
primary key (id)
);