Matt Purnell

Generate statements (ddl) to create all objects

Create statements for Module I Task II

  • November 26, 2017 at 12:24 PM
  • Visible to public
CREATE TABLE University
(
  University_ID INT NOT NULL,
  University_Name VARCHAR(40) NOT NULL,
  PRIMARY KEY (University_ID)
);

CREATE TABLE Course
(
  Professor VARCHAR(30) NOT NULL,
  Course_No INT NOT NULL,
  Section INT NOT NULL,
  Credit_Hours INT NOT NULL,
  Course_Name VARCHAR(30) NOT NULL,
  University_ID INT NOT NULL,
  PRIMARY KEY (Course_No),
  FOREIGN KEY (University_ID) REFERENCES University(University_ID)
);

CREATE TABLE Student
(
  Username VARCHAR(30) NOT NULL,
  ID INT NOT NULL,
  Major VARCHAR(30) NOT NULL,
  University_ID INT NOT NULL,
  Course_No INT NOT NULL,
  PRIMARY KEY (ID),
  FOREIGN KEY (University_ID) REFERENCES University(University_ID),
  FOREIGN KEY (Course_No) REFERENCES Course(Course_No)
);