Creating the database
Creating the database
-- Selecting the database for use id_depart VARCHAR(20) -- Foreign key referencing department
USE Gestion_universite; );
-- Creating the "Etudiant" table to store student information -- Adding a primary key constraint to "Professeur" table
nom VARCHAR(20), -- Student's last name -- Creating the "Departement" table to store department information
date_naissance DATE, -- Student's date of birth id_depart VARCHAR(20) PRIMARY KEY, -- Unique identifier for department
email VARCHAR(30) -- Student's email address nom_depart VARCHAR(20) -- Name of the department
); );
-- Adding a primary key constraint to "Etudiant" table -- Creating the "Cours" table to store course information
-- Creating the "Professeur" table to store professor information nom_cours VARCHAR(20) -- Name of the course
CREATE TABLE Inscription ( -- Adding a foreign key constraint to link "Professeur" with "Departement"
id_inscript VARCHAR(20) PRIMARY KEY, -- Unique identifier for each enrollment ALTER TABLE Professeur ADD CONSTRAINT FK_id_depart FOREIGN KEY(id_depart)
REFERENCES Departement(id_depart);
date_inscript DATE, -- Date of enrollment
id_note VARCHAR(20) PRIMARY KEY, -- Unique identifier for each grade entry
);