Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
if exists(
select 1 from sys.systable
where table_name='BON_COMMANDE'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table BON_COMMANDE
end if;
if exists(
select 1 from sys.systable
where table_name='BON_LIVRAISON'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table BON_LIVRAISON
end if;
if exists(
select 1 from sys.systable
where table_name='BON_PRELEVEMENT'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table BON_PRELEVEMENT
end if;
if exists(
select 1 from sys.systable
where table_name='COMPORTER'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table COMPORTER
end if;
if exists(
select 1 from sys.systable
where table_name='CONCERNE'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table CONCERNE
end if;
if exists(
select 1 from sys.systable
where table_name='CONTIENT'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table CONTIENT
end if;
if exists(
select 1 from sys.systable
where table_name='FOURNISSUER'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table FOURNISSUER
end if;
if exists(
select 1 from sys.systable
where table_name='MENU'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table MENU
end if;
if exists(
select 1 from sys.systable
where table_name='POSSEDER_CATALOGUE'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table POSSEDER_CATALOGUE
end if;
if exists(
select 1 from sys.systable
where table_name='RESTAURANT'
and table_type in ('BASE', 'GBL TEMP')
) then
drop table RESTAURANT
end if;
/*==============================================================*/
/* Table : BON_COMMANDE */
/*==============================================================*/
create table BON_COMMANDE
(
ID_BON_COM numeric not null,
ID_RESTO numeric not null,
DATE_BON_COM date null,
constraint PK_BON_COMMANDE primary key (ID_BON_COM)
);
/*==============================================================*/
/* Table : BON_LIVRAISON */
/*==============================================================*/
create table BON_LIVRAISON
(
ID_BON_LAIVR numeric not null,
ID_FOURNISSEUR numeric not null,
DATE_BON_LAIVR date null,
constraint PK_BON_LIVRAISON primary key (ID_BON_LAIVR)
);
/*==============================================================*/
/* Table : BON_PRELEVEMENT */
/*==============================================================*/
create table BON_PRELEVEMENT
(
ID_BON_PRELEV numeric not null,
ID_RESTO numeric not null,
DATE_BON_PRELEV date null,
constraint PK_BON_PRELEVEMENT primary key (ID_BON_PRELEV)
);
/*==============================================================*/
/* Table : COMPORTER */
/*==============================================================*/
create table COMPORTER
(
ID_ARTICLE numeric not null,
ID_MENU numeric not null,
constraint PK_COMPORTER primary key (ID_ARTICLE, ID_MENU)
);
/*==============================================================*/
/* Table : CONCERNE */
/*==============================================================*/
create table CONCERNE
(
ID_BON_COM numeric not null,
ID_FOURNISSEUR numeric not null,
constraint PK_CONCERNE primary key (ID_BON_COM, ID_FOURNISSEUR)
);
/*==============================================================*/
/* Table : CONTIENT */
/*==============================================================*/
create table CONTIENT
(
ID_ARTICLE numeric not null,
ID_BON_COM numeric not null,
constraint PK_CONTIENT primary key (ID_ARTICLE, ID_BON_COM)
);
/*==============================================================*/
/* Table : FOURNISSUER */
/*==============================================================*/
create table FOURNISSUER
(
ID_FOURNISSEUR numeric not null,
NOM_FOURNISSEUR varchar(50) null,
ADD_FOURNISSEUR varchar(250) null,
TEL_FOURNISSEUR numeric null,
SPECIALITE varchar(50) null,
constraint PK_FOURNISSUER primary key (ID_FOURNISSEUR)
);
/*==============================================================*/
/* Table : MENU */
/*==============================================================*/
create table MENU
(
ID_MENU numeric not null,
ID_RESTO numeric not null,
ENTRE varchar(100) null,
PLAT varchar(100) null,
DESSERT varchar(100) null,
DATE_MENU date null,
constraint PK_MENU primary key (ID_MENU)
);
/*==============================================================*/
/* Table : POSSEDER_CATALOGUE */
/*==============================================================*/
create table POSSEDER_CATALOGUE
(
ID_ARTICLE numeric not null,
ID_FOURNISSEUR numeric not null,
constraint PK_POSSEDER_CATALOGUE primary key (ID_ARTICLE,
ID_FOURNISSEUR)
);
/*==============================================================*/
/* Table : RESTAURANT */
/*==============================================================*/
create table RESTAURANT
(
ID_RESTO numeric not null,
TYPE_RESTO varchar(50) null,
NBR_BENEFICIAIRE numeric null,
constraint PK_RESTAURANT primary key (ID_RESTO)
);