Vous êtes sur la page 1sur 3

create database GESTION_DE

/*==============================================================*/
/* Table: ARTICLE */
/*==============================================================*/
create table ARTICLE
(
ID_ARTICLE integer IDENTITY not null,
ID_TYPE_ARTCLE integer not null,
NOM_ARTICLE char(50) not null,
DESIGNATION_ARTICLE char(256) not null,
QUANTITE_ARTICLE integer not null,
PRIX_ACHAT float not null,
PRIX_VENTE_ float not null,
IMAGE_ARTICLE IMAGE null,
constraint PK_ARTICLE primary key (ID_ARTICLE)
);

/*==============================================================*/
/* Table: AVOIR */
/*==============================================================*/
create table AVOIR
(
ID_ARTICLE integer IDENTITY not null,
ID_LIVRAISON integer not null,
QUANTITE_LIVRAISON integer not null,
constraint PK_AVOIR primary key (ID_ARTICLE, ID_LIVRAISON)
);

/*==============================================================*/
/* Table: CLIENT */
/*==============================================================*/
create table CLIENT
(
ID_CLIENT_ integer IDENTITY not null,
CIN_CLIENT_ integer UNIQUE null,
NOM_CLIENT_ char(10) null,
PRENOM_CLIENT_ char(50) null,
ADRESSE_CLIENT_ char(50) null,
TEL_CLIENT_ integer UNIQUE null,
EMAIL_CLIENT_ char(50) UNIQUE null,
constraint PK_CLIENT primary key (ID_CLIENT_)
);

/*==============================================================*/
/* Table: COMMANDE */
/*==============================================================*/
create table COMMANDE
(
ID_COMMANDE_ integer not null,
ID_CLIENT_ integer not null,
DATE_LIVRAISON date not null,
constraint PK_COMMANDE primary key (ID_COMMANDE_)
);

/*==============================================================*/
/* Table: ETRE */
/*==============================================================*/
create table ETRE
(
ID_ARTICLE integer not null,
ID_COMMANDE_ integer not null,
QUANTITE_COMMANDE integer not null,
constraint PK_ETRE primary key (ID_ARTICLE, ID_COMMANDE_)
);

/*==============================================================*/
/* Table: FACTURE */
/*==============================================================*/
create table FACTURE
(
ID_FACTURE_ integer IDENTITY not null,
ID_COMMANDE_ integer not null,
ID_LIVRAISON integer not null,
MONTANT float not null,
constraint PK_FACTURE primary key (ID_FACTURE_)
);

/*==============================================================*/
/* Table: FOURNISSEUR */
/*==============================================================*/
create table FOURNISSEUR
(
ID_FOURNISSEUR integer IDENTITY not null,
CIN_FOURNISSEUR char(10) UNIQUE null,
NOM_FOURNISSEUR char(50) null,
PRENOM_FOURNISSEUR char(50) null,
ADRESSE_FOURNISSEUR char(50) null,
TEL_FOURNISSEUR integer UNIQUE null,
EMAIL_FOURNISSEUR char(50) UNIQUE null,
constraint PK_FOURNISSEUR primary key (ID_FOURNISSEUR)
);

/*==============================================================*/
/* Table: LIVIRAISON */
/*==============================================================*/
create table LIVIRAISON
(
ID_LIVRAISON integer IDENTITY not null,
ID_FOURNISSEUR integer not null,
DATE_LIVRAISON date null,
DELAIS_LIVRAISON date null,
constraint PK_LIVIRAISON primary key (ID_LIVRAISON)
);

/*==============================================================*/
/* Table: STOCK */
/*==============================================================*/
create table STOCK
(
ID_STOCK_ integer IDENTITY not null,
ID_UTILISATEUR_ integer not null,
UTI_ID_UTILISATEUR_ integer not null,
ID_ARTICLE integer not null,
DATE_SORTIE date null,
constraint PK_STOCK primary key (ID_STOCK_)
);
/*==============================================================*/
/* Table: TYPE_ARTICLE */
/*==============================================================*/
create table TYPE_ARTICLE
(
ID_TYPE_ARTCLE integer not null,
CATEGORIE char(50) UNIQUE null,
DESCRIPTION_TYPE_ARTICLE char(50) null,
constraint PK_TYPE_ARTICLE primary key (ID_TYPE_ARTCLE)
);

/*==============================================================*/
/* Table: UTILISATEUR */
/*==============================================================*/
create table UTILISATEUR
(
ID_UTILISATEUR_ integer IDENTITY not null,
NOM_UTILISATEUR_ char(50) null,
PRENOM_UTILISATEUR char(50) null,
DATE_NAISSANCE date null,
MOT_PASS char(50) null,
QUESTION char(50) null,
REPONSE_ char(50) null,
constraint PK_UTILISATEUR primary key (ID_UTILISATEUR_)
);

Vous aimerez peut-être aussi