The document contains SQL statements that create and define the structure of multiple tables for a school database. The tables include courses, students, class sessions, and student enrollments. Columns are defined along with primary keys and foreign key constraints are added to link the tables together. Indexes are also added to some columns.
The document contains SQL statements that create and define the structure of multiple tables for a school database. The tables include courses, students, class sessions, and student enrollments. Columns are defined along with primary keys and foreign key constraints are added to link the tables together. Indexes are also added to some columns.
The document contains SQL statements that create and define the structure of multiple tables for a school database. The tables include courses, students, class sessions, and student enrollments. Columns are defined along with primary keys and foreign key constraints are added to link the tables together. Indexes are also added to some columns.
COURS(sigle VARCHAR(45)PRIMARY KEY not null ,libelle
varchar(45),responsable VARCHAR(45) not null,nombreSeances INT); ALTER TABLE ecole.cours ADD INDEX responsable_idx (responsable ASC) VISIBLE; ALTER TABLE ecole.cours ADD CONSTRAINT responsable FOREIGN KEY (responsable) REFERENCES ecole.enseignant (Id_e) ON DELETE NO ACTION ON UPDATE NO ACTION; Create table ecole.ETUDIANT (NumApogee INT PRIMARY KEY not null , nom varchar(45), prenom varchar(45), age INT); Create table ecole.SEANCE (id_s varchar(45) PRIMARY KEY not null, cours varchar(45) not null , NumeroS INT, type varchar(45), date date, salle varchar(5) , heureDebut VARCHAR(20), heureFin VARCHAR(20), enseignant VARCHAR(45) not null); ALTER TABLE ecole.seance ADD INDEX cours_idx (cours ASC) VISIBLE,ADD INDEX enseignant_idx (enseignant ASC) VISIBLE; ALTER TABLE ecole.seance ADD CONSTRAINT cours FOREIGN KEY (cours) REFERENCES ecole.cours (sigle) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT enseignant FOREIGN KEY (enseignant) REFERENCES ecole.enseignant (Id_e) ON DELETE NO ACTION ON UPDATE NO ACTION; Create table ecole.inscription (NumApogee int not null,cours VARCHAR(45)not null); ALTER TABLE ecole.inscription ADD INDEX NumApogee_idx (NumApogee ASC) VISIBLE,ADD INDEX cours_idx (cours ASC) VISIBLE; ALTER TABLE ecole.inscription ADD CONSTRAINT NumApogee FOREIGN KEY (NumApogee) REFERENCES ecole.etudiant (NumApogee) ON DELETE NO ACTION ON UPDATE NO ACTION,ADD CONSTRAINT cours FOREIGN KEY (cours) REFERENCES ecole.cours (sigle) ON DELETE NO ACTION ON UPDATE NO ACTION; Create table ecole.remarques (id_r varchar(45) PRIMARY KEY not null,libelle VARCHAR(45)); Drop table ecole.remarques;