1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
create table trancheHoraire
(
IdTrancheHoraire tinyint not null primary key identity(1,1),
libelleTrancheHoraire char(11) not null,
heureMini smallDateTime not null,
heureMaxi smallDateTime not null
)
Create table typeMachine
(
IdTypeMachine tinyint not null identity(1,1) primary key,
libelleTypeMachine varchar(5) not null,
numRecetteMini int not null,
numRecetteMaxi int not null
) ;
Create table Etablissement
(
codeEtablissement char(8) not null primary key,
libelleEtablissement varchar(20) not null,
) ;
Create table Categorie
(
codeCategorie tinyint not null primary key identity(1,1),
libelleCategorie varchar(20) not null,
) ;
Create table ModePaiement
(
codeModePaiement char(2) not null primary key ,
libelleModePaiement varchar(20) not null,
) ;
Create table PointVente
(
IdPointVente tinyint primary key not null identity(1,1),
codeUNI varchar(6) not null ,
libellePointVente varchar(50) not null,
codeEtablissement char(8) null foreign key references Etablissement(codeEtablissement),
codeCategorie tinyint null foreign key references Categorie(codeCategorie),
) ;
create table ligne
(
IdMachine tinyint not null,
dateTransaction smallDateTime not null,
decision char(1) not null,
codeModePaiement char(2) not null foreign key references ModePaiement(codeModePaiement),
nbDossiers tinyint not null,
sommeTransaction smallmoney not null,
IdPointVente tinyint not null foreign key references PointVente(IdPointVente),
trancheHoraire tinyint not null foreign key references trancheHoraire(IdTrancheHoraire),
IdTypeMachine tinyint not null foreign key references typeMachine(IdTypeMAchine)
); |
Partager