Skip to content
Extraits de code Groupes Projets
Valider d0df509e rédigé par JAYASHANKAR Koumaarashankar's avatar JAYASHANKAR Koumaarashankar
Parcourir les fichiers

Merge branch 'master' of git.iiens.net:jayashan2015/projet_web

create modifie
parents 9029ded6 eac27765
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -3,6 +3,7 @@
-- # File : create.sql
-- # Date : 04/2016
-- # Function : Create the database
-- # Nom de base : gestion
-- ###################################################################
DROP TABLE IF EXISTS compte_client;
DROP TABLE IF EXISTS salle;
......@@ -27,16 +28,16 @@ CREATE TABLE compte_client(
min_places INTEGER,
moyen_places INTEGER,
CONSTRAINT pk_salle PRIMARY KEY (n_salle),
CONSTRAINT vip CHECK (vip_places >= 0);
CONSTRAINT min CHECK (min_places >= 0);
CONSTRAINT moyen CHECK (moyen_places >= 0);
CONSTRAINT vip CHECK (vip_places >= 0),
CONSTRAINT min CHECK (min_places >= 0),
CONSTRAINT moyen CHECK (moyen_places >= 0)
);
CREATE TABLE piece(
nom_piece VARCHAR(100),
realisateur VARCHAR(100),
heros VARCHAR(100),
heroine VARCHAR0(100),
heroine VARCHAR(100),
CONSTRAINT pk_piece PRIMARY KEY (nom_piece)
);
......@@ -69,12 +70,12 @@ CREATE TABLE billet(
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 type_de_pourcentage CHECK (pourcentage 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.
Veuillez vous inscrire ou vous pour commenter