Commit 516b3851204f055e91aa2833dccd7b727e554637
1 parent
7c73e919
Re: Fichier base de données
Showing
1 changed file
with
6 additions
and
9 deletions
Show diff stats
BDD.sql
@@ -2,15 +2,12 @@ CREATE TABLE Utilisateur ( | @@ -2,15 +2,12 @@ CREATE TABLE Utilisateur ( | ||
2 | loglille1 char(30), | 2 | loglille1 char(30), |
3 | login char(30) PRIMARY KEY, | 3 | login char(30) PRIMARY KEY, |
4 | mdp char(30), | 4 | mdp char(30), |
5 | - droit integer CHECK(droit >= 0 AND droit<=3) | 5 | + droit integer DEFAULT 0 |
6 | ); | 6 | ); |
7 | 7 | ||
8 | - | ||
9 | CREATE TABLE Client ( | 8 | CREATE TABLE Client ( |
10 | - nom char(30), | ||
11 | - prenom char(30), | ||
12 | loglille1 char(30) PRIMARY KEY, | 9 | loglille1 char(30) PRIMARY KEY, |
13 | - solde float 5.2, | 10 | + solde float(5.2), |
14 | idcarte integer, | 11 | idcarte integer, |
15 | credit boolean | 12 | credit boolean |
16 | ); | 13 | ); |
@@ -18,16 +15,16 @@ CREATE TABLE Client ( | @@ -18,16 +15,16 @@ CREATE TABLE Client ( | ||
18 | 15 | ||
19 | CREATE TABLE Prix ( | 16 | CREATE TABLE Prix ( |
20 | produit char(30), | 17 | produit char(30), |
21 | - prix float 5.2 | 18 | + prix float(5.2) |
22 | ); | 19 | ); |
23 | 20 | ||
24 | 21 | ||
25 | CREATE TABLE Transactions ( | 22 | CREATE TABLE Transactions ( |
26 | id serial PRIMARY KEY, | 23 | id serial PRIMARY KEY, |
27 | type char(15), | 24 | type char(15), |
28 | - date_heure char(15), | ||
29 | - montant float 5.2, | ||
30 | - quantite interger 2, | 25 | + date datetime, |
26 | + montant float(5.2), | ||
27 | + quantite integer(2), | ||
31 | utilisateur char(30) REFERENCES Utilisateur(login), | 28 | utilisateur char(30) REFERENCES Utilisateur(login), |
32 | client char(30) REFERENCES Client(loglille1), | 29 | client char(30) REFERENCES Client(loglille1), |
33 | valide boolean | 30 | valide boolean |