Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design2
/
2014104149
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Graduate
2020-11-18 18:20:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cc99ac31a4c8f9fe55f1412d06f8d16f9cf218be
cc99ac31
1 parent
b541e824
Update DB schema
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
52 deletions
DB/SQL/create_database_attendance.sql
DB/SQL/create_table_lecture.sql
DB/SQL/create_table_student.sql
DB/SQL/create_database_attendance.sql
View file @
cc99ac3
CREATE
DATABASE
attendance
DEFAULT
CHARACTER
SET
UTF8
;
use
attendance
;
\ No newline at end of file
use
attendance
;
CREATE
TABLE
lecture
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
lecture_name
VARCHAR
(
50
),
PRIMARY
KEY
(
lecture_id
)
);
CREATE
TABLE
lecture_students
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
student_id
VARCHAR
(
10
)
UNIQUE
,
FOREIGN
KEY
(
lecture_id
)
REFERENCES
lecture
(
lecture_id
),
FOREIGN
KEY
(
student_id
)
REFERENCES
student
(
student_id
)
);
CREATE
TABLE
student_attendance
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
student_id
VARCHAR
(
10
)
NOT
NULL
,
status
VARCHAR
(
10
)
NOT
NULL
,
attendance_time
DATETIME
DEFAULT
CURRENT_TIMESTAMP
,
FOREIGN
KEY
(
lecture_id
)
REFERENCES
lecture
(
lecture_id
),
FOREIGN
KEY
(
student_id
)
REFERENCES
student
(
student_id
)
);
CREATE
TABLE
undefined_image
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
image
MEDIUMBLOB
NOT
NULL
,
width
SMALLINT
NOT
NULL
,
height
SMALLINT
NOT
NULL
,
timestamp
DATETIME
DEFAULT
CURRENT_TIMESTAMP
,
FOREIGN
KEY
(
lecture_id
)
REFERENCES
lecture
(
lecture_id
)
);
CREATE
TABLE
lecture_schedule
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
lecture_day
TINYINT
NOT
NULL
,
lecture_room
VARCHAR
(
50
)
NOT
NULL
,
lecture_start_time
TIME
NOT
NULL
,
lecture_end_time
TIME
NOT
NULL
,
FOREIGN
KEY
(
lecture_id
)
REFERENCES
lecture
(
lecture_id
)
);
CREATE
TABLE
student
(
student_id
VARCHAR
(
10
)
NOT
NULL
,
student_name
VARCHAR
(
50
)
NOT
NULL
,
PRIMARY
KEY
(
student_id
)
);
CREATE
TABLE
student_embedding
(
student_id
VARCHAR
(
10
)
NOT
NULL
,
embedding_date
DATE
NOT
NULL
,
embedding
BLOB
NOT
NULL
,
FOREIGN
KEY
(
student_id
)
REFERENCES
student
(
student_id
)
);
\ No newline at end of file
...
...
DB/SQL/create_table_lecture.sql
deleted
100644 → 0
View file @
b541e82
CREATE
TABLE
lecture
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
lecture_name
VARCHAR
(
50
),
PRIMARY
KEY
(
lecture_id
)
);
CREATE
TABLE
lecture_students
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
student_id
VARCHAR
(
10
)
UNIQUE
,
FOREIGN
KEY
(
lecture_id
)
REFERENCES
lecture
(
lecture_id
),
FOREIGN
KEY
(
student_id
)
REFERENCES
student
(
student_id
)
);
CREATE
TABLE
student_attendance
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
student_id
VARCHAR
(
10
)
NOT
NULL
,
status
VARCHAR
(
10
)
NOT
NULL
,
attendance_time
DATETIME
DEFAULT
CURRENT_TIMESTAMP
,
FOREIGN
KEY
(
lecture_id
)
REFERENCES
lecture
(
lecture_id
),
FOREIGN
KEY
(
student_id
)
REFERENCES
student
(
student_id
)
);
CREATE
TABLE
undefined_image
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
image
MEDIUMBLOB
NOT
NULL
,
width
SMALLINT
NOT
NULL
,
height
SMALLINT
NOT
NULL
,
timestamp
DATETIME
DEFAULT
CURRENT_TIMESTAMP
,
FOREIGN
KEY
(
lecture_id
)
REFERENCES
lecture
(
lecture_id
)
);
CREATE
TABLE
lecture_schedule
(
lecture_id
VARCHAR
(
20
)
NOT
NULL
,
lecture_day
TINYINT
NOT
NULL
,
lecture_room
VARCHAR
(
50
)
NOT
NULL
,
lecture_start_time
TIME
NOT
NULL
,
lecture_end_time
TIME
NOT
NULL
,
FOREIGN
KEY
(
lecture_id
)
REFERENCES
lecture
(
lecture_id
)
);
\ No newline at end of file
DB/SQL/create_table_student.sql
deleted
100644 → 0
View file @
b541e82
CREATE
TABLE
student
(
student_id
VARCHAR
(
10
)
NOT
NULL
,
student_name
VARCHAR
(
50
)
NOT
NULL
,
PRIMARY
KEY
(
student_id
)
);
CREATE
TABLE
student_embedding
(
student_id
VARCHAR
(
10
)
NOT
NULL
,
embedding_date
DATE
NOT
NULL
,
embedding
BLOB
NOT
NULL
,
FOREIGN
KEY
(
student_id
)
REFERENCES
student
(
student_id
)
);
\ No newline at end of file
Please
register
or
login
to post a comment