Ricardo J Vargas

Generate statements (ddl) to create all objects

This is the creation of the tables.

  • October 29, 2017 at 7:39 PM
  • Visible to public
CREATE TABLE Students
(
  id int PRIMARY KEY,
  name CHAR(30) NOT NULL,
  classroom_id INT NOT NULL,
  class_id CHAR(30) NOT NULL,
  FOREIGN KEY (classroom_id) REFERENCES classrooms(Classroom_id),
  FOREIGN KEY (class_id) REFERENCES Class (Class_id)
  );
  
CREATE TABLE Classrooms
(
 Classroom_id INT NOT NULL,
 Classroom_number INT NOT NULL,
 PRIMARY KEY (Classroom_id)
);

CREATE TABLE Class
(
 Class_id INT NOT NULL,
 Class_id CHAR(30) NOT NULL,
 PRIMARY KEY (Class_id)
);