Commit b4680d36 authored by Ismail Merzougui's avatar Ismail Merzougui

Code SQL normalisé

parent 952b872c
......@@ -2,18 +2,36 @@ CREATE TYPE Etat as ENUm ('Abime','perdu','bon','neuf');
CREATE TYPE TypeDoc as ENUm ('Livre','Film','Musique');
CREATE TABLE Adherent
CREATE TABLE Email
(
IdCarte VARCHAR(100) NOT NULL,
nom VARCHAR(100) NOT NULL,
email VARCHAR(100),
prenom VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
login VARCHAR(100) NOT NULL UNIQUE,
mdp VARCHAR(100) NOT NULL,
nom VARCHAR(100) NOT NULL,
numeroTel VARCHAR(10) NOT NULL UNIQUE,
PRIMARY KEY (email)
);
CREATE TABLE Login
(
login VARCHAR(100) PRIMARY KEY,
email VARCHAR(100) NOT NULL UNIQUE,
motdepasse VARCHAR(100) NOT NULL,
Blackliste boolean NOT NULL,
PRIMARY KEY (Idcarte)
FOREIGN KEY (email) REFERENCES Email
);
CREATE TABLE Adherent
(
IdCarte VARCHAR(100) PRIMARY KEY,
login VARCHAR(100) NOT NULL UNIQUE,
FOREIGN KEY (login) REFERENCES Login
);
CREATE TABLE Contributeur
(
......@@ -30,17 +48,21 @@ PRIMARY KEY (nom,prenom,dateDeNaissance)
CREATE TABLE EmailPersonnel
(
email VARCHAR(100) PRIMARY KEY,
nom VARCHAR(100) NOT NULL,
prenom VARCHAR(100) NOT NULL,
numeroTel VARCHAR(100) Not NULL
);
CREATE TABLE Personnel
(
login VARCHAR(100) NOT NULL ,
nom VARCHAR(100) NOT NULL,
prenom VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
mdp VARCHAR(100) NOT NULL,
numeroTel VARCHAR(100) NOT NULL UNIQUE,
PRIMARY KEY (login)
PRIMARY KEY (login),
FOREIGN KEY (email) REFERENCES EmailPersonnel
);
......@@ -107,16 +129,30 @@ FOREIGN KEY (code) REFERENCES Document
INSERT INTO email(email, prenom, nom, numeroTel)
VALUES('ismail.sylla@etu.utc.fr','Ismail','Sylla',0654326698);
INSERT INTO email(email, prenom, nom, numeroTel)
VALUES('ismail.merzougui@etu.utc.fr','Ismail','Merzougui',0684532155);
INSERT INTO email(email, prenom, nom, numeroTel)
VALUES('sofiane.mahjoub@etu.utc.fr','Sofiane','Mahjoub',0789562345);
INSERT INTO Adherent(IdCarte,nom,prenom, email,login,mdp, numeroTel,Blackliste)
VALUES(00776,'Sylla','Ismail','ismail.sylla@etu.utc.fr','syllaism','laloalo56',0654326698,'t');
INSERT INTO Adherent(IdCarte,nom,prenom, email,login,mdp, numeroTel,Blackliste)
VALUES(00001,'Mahjoub','Sofiane','sofiane.mahjoub@etu.utc.fr','mahjoubsof','fu5uo75',0789562345,'f');
INSERT INTO Adherent(IdCarte,nom,prenom, email,login,mdp, numeroTel,Blackliste)
VALUES(000026,'Merzougui','Ismail','ismail.merzougui@etu.utc.fr','merzouguiism','lmmlmls45',0684532155,'f');
INSERT INTO Login(login, email, motdepasse, Blackliste)
VALUES('syllaism','ismail.sylla@etu.utc.fr','laloalo56', 't');
INSERT INTO Login(login, email, motdepasse, Blackliste)
VALUES('mahjoubsof','sofiane.mahjoub@etu.utc.fr','fu5uo75', 'f');
INSERT INTO Login(login, email, motdepasse, Blackliste)
VALUES('merzouguiism','ismail.merzougui@etu.utc.fr','lmmlmls45', 'f');
INSERT INTO Adherent(IdCarte,login)
VALUES(00776, 'syllaism');
INSERT INTO Adherent(IdCarte,login)
VALUES(00001, 'mahjoubsof');
INSERT INTO Adherent(IdCarte,login)
VALUES(000026,'merzouguiism');
......@@ -157,17 +193,25 @@ INSERT INTO Contributeur(nom,prenom, DateDeNaissance,nationalite)
VALUES('Henley', 'Don',TO_DATE('19470622','YYYYMMDD'), 'Americain');
INSERT INTO EmailPersonnel(nom,prenom, email, numeroTel)
VALUES('Ribery','Frank','frank.ribery@insa.fr',0754326698);
INSERT INTO EmailPersonnel(nom,prenom, email, numeroTel)
VALUES('Kyle','Junior','junior.kyke@w9.fr',0783246985);
INSERT INTO EmailPersonnel(nom,prenom, email, numeroTel)
VALUES('Henni','Mohammed','bahouelogique@snapchat.fr',0654669877);
INSERT INTO Personnel(login, email,mdp)
VALUES('fribery','frank.ribery@insa.fr','jojoj45');
INSERT INTO Personnel(login,email,mdp)
VALUES('jkyle','junior.kyke@w9.fr','jofooj45');
INSERT INTO Personnel(login,nom,prenom, email,mdp, numeroTel)
VALUES('fribery','Ribery','Frank','frank.ribery@insa.fr','jojoj45',0754326698);
INSERT INTO Personnel(login,nom,prenom, email,mdp, numeroTel)
VALUES('jkyle','Kyle','Junior','junior.kyke@w9.fr','jofooj45',0783246985);
INSERT INTO Personnel(login,nom,prenom, email,mdp, numeroTel)
VALUES('MHenni','Henni','Mohammed','bahouelogique@snapchat.fr','jofooj45',0654669877);
INSERT INTO Personnel(login,email,mdp)
VALUES('MHenni','bahouelogique@snapchat.fr','jofooj45');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment