Graduate

Add SQL file

1 +CREATE DATABASE attendance DEFAULT CHARACTER SET UTF8;
2 +use attendance;
...\ No newline at end of file ...\ No newline at end of file
1 +CREATE TABLE lecture(
2 +lecture_id VARCHAR(20) NOT NULL,
3 +lecture_name VARCHAR(50),
4 +lecture_room VARCHAR(50) NOT NULL,
5 +PRIMARY KEY(lecture_id)
6 +);
7 +
8 +CREATE TABLE lecture_students(
9 +lecture_id VARCHAR(20) NOT NULL,
10 +student_id VARCHAR(10) NOT NULL,
11 +FOREIGN KEY (lecture_id) REFERENCES lecture(lecture_id),
12 +FOREIGN KEY (student_id) REFERENCES student(student_id)
13 +);
14 +
15 +CREATE TABLE student_attendance(
16 +lecture_id VARCHAR(20) NOT NULL,
17 +student_id VARCHAR(10) NOT NULL,
18 +attendance_date DATE NOT NULL,
19 +FOREIGN KEY (lecture_id) REFERENCES lecture(lecture_id),
20 +FOREIGN KEY (student_id) REFERENCES student(student_id)
21 +);
22 +
23 +CREATE TABLE undefined_image(
24 +lecture_id VARCHAR(20) NOT NULL,
25 +date DATE NOT NULL,
26 +image BLOB NOT NULL,
27 +width SMALLINT NOT NULL,
28 +height SMALLINT NOT NULL,
29 +FOREIGN KEY (lecture_id) REFERENCES lecture(lecture_id)
30 +);
31 +
32 +CREATE TABLE lecture_schedule(
33 +lecture_id VARCHAR(20) NOT NULL,
34 +lecture_day VARCHAR(20) NOT NULL,
35 +lecture_start_time TIME NOT NULL,
36 +lecture_end_time TIME NOT NULL,
37 +FOREIGN KEY (lecture_id) REFERENCES lecture(lecture_id)
38 +);
...\ No newline at end of file ...\ No newline at end of file
1 +CREATE TABLE student(
2 +student_id VARCHAR(10) NOT NULL,
3 +student_name VARCHAR(50) NOT NULL,
4 +PRIMARY KEY(student_id)
5 +);
6 +
7 +CREATE TABLE student_embedding(
8 +student_id VARCHAR(10) NOT NULL,
9 +embedding_date DATE NOT NULL,
10 +embedding BLOB NOT NULL,
11 +FOREIGN KEY (student_id) REFERENCES student(student_id)
12 +);
...\ No newline at end of file ...\ No newline at end of file