The document contains SQL statements that define and modify tables in a database for a school management system. The tables created include courses, students, class sessions, and student enrollments. Foreign key constraints are added to link the tables together and maintain referential integrity of the data. One table for remarks is also created and then dropped.
The document contains SQL statements that define and modify tables in a database for a school management system. The tables created include courses, students, class sessions, and student enrollments. Foreign key constraints are added to link the tables together and maintain referential integrity of the data. One table for remarks is also created and then dropped.
The document contains SQL statements that define and modify tables in a database for a school management system. The tables created include courses, students, class sessions, and student enrollments. Foreign key constraints are added to link the tables together and maintain referential integrity of the data. One table for remarks is also created and then dropped.
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.inscr 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 (Sarchar(45) PRIMARY KEY not null,libelle VARCHAR(45)); Drop table ecole.remarques;