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
| create table menus
(
`id` int not null auto_increment,
`date creation` date default now(),
`date modification` date,
`etat` bool default true,
`nom` varchar(64) not null,
constraint pk_menus primary key(id)
)engine=myisam auto_increment=1;
create table `types plats`
(
`id` int not null auto_increment,
`nom` varchar(64) not null,
constraint pk_types_plats primary key(id)
)engine=myisam auto_increment=1;
create table `periodes`
(
`id` int not null auto_increment,
`nom` varchar(64) not null,
constraint pk_periodes primary key(id)
)engine=myisam auto_increment=1;
create table plats
(
`id` int not null auto_increment,
`id type` int not null,
`id periode` int not null,
`prix` decimal(5,2) not null,
`date creation` date default now(),
`date modification` date,
`nom` varchar(64) not null,
constraint pk_plats primary key(id),
key k_plats_types(`id type`),
key k_plats_periodes(`id periode`)
)engine=myisam auto_increment=1;
create table `prix menu`
(
`id` int not null auto_increment,
`id menu` int not null,
`valeur` decimal(5,2) not null,
`designation` varchar(64) not null,
constraint pk_prix primary key(id),
key k_prix_menus(`id menu`)
)engine=myisam auto_increment=1;
create table contenu
(
`id` int not null auto_increment,
`id menu` int not null,
`id plat` int not null,
constraint pk_contenu primary key(id),
key k_contenu_menus(`id menu`),
key k_contenu_plats(`id menu`)
)engine=myisam auto_increment=1; |