Skip to content
Extraits de code Groupes Projets
Valider c72a5af8 rédigé par qixiang peng's avatar qixiang peng
Parcourir les fichiers

update create.sql

parent 0205360a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -41,11 +41,12 @@ CREATE TABLE piece(
);
CREATE TABLE representation(
n_representation INTEGER,
nom_piece VARCHAR(100),
horaire TIME,
jour DATE,
n_salle INTEGER,
CONSTRAINT pk_representation PRIMARY KEY (n_salle,horaire,jour),
CONSTRAINT pk_representation PRIMARY KEY (n_representation),
CONSTRAINT fk_representation_salle
FOREIGN KEY (n_salle) REFERENCES Salle ON DELETE RESTRICT,
CONSTRAINT fk_representation_piece
......@@ -62,6 +63,18 @@ CREATE TABLE place(
CONSTRAINT type_de_place CHECK (p_type IN ('vip', 'min','moyen'))
);
CREATE TABLE billet(
n_compte INTEGER,
n_place INTEGER,
n_representation INTEGER,
pourcentage DECIMAL,
CONSTRAINT pk_billet PRIMARY KEY (n_compte,n_place,n_representation),
CONSTRAINT type_de_place CHECK (p_type IN (0.5, 0.6, 0.8)),
CONSTRAINT fk_billet_place
FOREIGN KEY (n_place) REFERENCES place ON DELETE CASCADE,
CONSTRAINT fk_billet_compte
FOREIGN KEY (n_compte) REFERENCES compte_client ON DELETE CASCADE,
CONSTRAINT fk_billet_representation
FOREIGN KEY (n_representation) REFERENCES representation ON DELETE CASCADE
)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter