0% found this document useful (0 votes)
4 views1 page

PHP Tables

Uploaded by

gichobiraylee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

PHP Tables

Uploaded by

gichobiraylee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

-- Create Lecturer Table

CREATE TABLE Lecturer (

lecturer_id INT PRIMARY KEY AUTO_INCREMENT,

lecturer_name VARCHAR(100) NOT NULL,

lecturer_email VARCHAR(100) UNIQUE NOT NULL

);

-- Create Course Table

CREATE TABLE Course (

course_id INT PRIMARY KEY AUTO_INCREMENT,

course_name VARCHAR(100) NOT NULL,

course_code VARCHAR(50) UNIQUE NOT NULL,

lecturer_id INT,

FOREIGN KEY (lecturer_id) REFERENCES Lecturer(lecturer_id) ON DELETE SET NULL

);

-- Create Assignment Table

CREATE TABLE Assignment (

assignment_id INT PRIMARY KEY AUTO_INCREMENT,

assignment_title VARCHAR(100) NOT NULL,

assignment_description TEXT,

due_date DATE,

course_id INT,

FOREIGN KEY (course_id) REFERENCES Course(course_id) ON DELETE CASCADE

);

You might also like