CREATE TABLE atudent
(
student_id_ INT NOT NULL,
address INT NOT NULL,
Gender INT NOT NULL,
Birthday INT NOT NULL,
Program INT NOT NULL,
Class INT NOT NULL,
Name INT NOT NULL,
Phone INT NOT NULL,
Ssn INT NOT NULL,
PRIMARY KEY (student_id_)
);
CREATE TABLE Department
(
Department_id INT NOT NULL,
Name INT NOT NULL,
Code INT NOT NULL,
College INT NOT NULL,
PRIMARY KEY (Department_id)
);
CREATE TABLE instructor
(
instructor_id INT NOT NULL,
Name INT NOT NULL,
title INT NOT NULL,
Ssn INT NOT NULL,
Department_id INT NOT NULL,
PRIMARY KEY (instructor_id),
FOREIGN KEY (Department_id) REFERENCES Department(Department_id)
);
CREATE TABLE Course
(
Course_id INT NOT NULL,
description INT NOT NULL,
prerequisite INT NOT NULL,
Name INT NOT NULL,
Number INT NOT NULL,
PRIMARY KEY (Course_id)
);
CREATE TABLE section_
(
section_id INT NOT NULL,
semester INT NOT NULL,
Year INT NOT NULL,
Numer INT NOT NULL,
instructor_id INT NOT NULL,
Course_id INT NOT NULL,
PRIMARY KEY (section_id),
FOREIGN KEY (instructor_id) REFERENCES instructor(instructor_id),
FOREIGN KEY (Course_id) REFERENCES Course(Course_id)
);
CREATE TABLE Enrolls
(
Grade INT NOT NULL,
student_id_ INT NOT NULL,
section_id INT NOT NULL,
FOREIGN KEY (student_id_) REFERENCES atudent(student_id_),
FOREIGN KEY (section_id) REFERENCES section_(section_id)
);