Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
timetabling/university_time_table.sql
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
128 lines (107 sloc)
3.55 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- File generated with SQLiteStudio v3.2.1 on Fri Dec 6 08:20:12 2019 | |
-- | |
-- Text encoding used: System | |
-- | |
PRAGMA foreign_keys = off; | |
BEGIN TRANSACTION; | |
-- Table: lecturer_module_table | |
DROP TABLE IF EXISTS lecturer_module_table; | |
CREATE TABLE lecturer_module_table ( | |
lecturer VARCHAR REFERENCES lecturer_table (Lecturer_ID), | |
module REFERENCES module (code) | |
); | |
INSERT INTO lecturer_module_table ( | |
lecturer, | |
module | |
) | |
VALUES ( | |
'123456', | |
4005 | |
); | |
INSERT INTO lecturer_module_table ( | |
lecturer, | |
module | |
) | |
VALUES ( | |
'654321', | |
4000 | |
); | |
-- Table: lecturer_table | |
DROP TABLE IF EXISTS lecturer_table; | |
CREATE TABLE lecturer_table ( | |
Lecturer_ID VARCHAR (6) PRIMARY KEY, | |
name VARCHAR (30), | |
number INT (10) | |
); | |
INSERT INTO lecturer_table ( | |
Lecturer_ID, | |
name, | |
number | |
) | |
VALUES ( | |
'123456', | |
'David', | |
7778969365 | |
); | |
INSERT INTO lecturer_table ( | |
Lecturer_ID, | |
name, | |
number | |
) | |
VALUES ( | |
'654321', | |
'Matthew', | |
7778965412 | |
); | |
-- Table: module | |
DROP TABLE IF EXISTS module; | |
CREATE TABLE module ( | |
code INT (4) PRIMARY KEY, | |
name VARCHAR (30) | |
); | |
INSERT INTO module ( | |
code, | |
name | |
) | |
VALUES ( | |
4000, | |
'Maths' | |
); | |
INSERT INTO module ( | |
code, | |
name | |
) | |
VALUES ( | |
4005, | |
'database systems' | |
); | |
-- Table: students_table | |
DROP TABLE IF EXISTS students_table; | |
CREATE TABLE students_table ( | |
student_ID INT (10) PRIMARY KEY, | |
name VARCHAR (6), | |
number INT (10) | |
); | |
INSERT INTO students_table ( | |
student_ID, | |
name, | |
number | |
) | |
VALUES ( | |
91856396, | |
'Ahmad', | |
5639621 | |
); | |
INSERT INTO students_table ( | |
student_ID, | |
name, | |
number | |
) | |
VALUES ( | |
818695, | |
'Sid', | |
99874520 | |
); | |
COMMIT TRANSACTION; | |
PRAGMA foreign_keys = on; |