0% found this document useful (0 votes)
13 views

SQL Plus

The document contains SQL statements that create tables for an application that manages clients, suppliers, offers, purchase orders, delivery notes, invoices, payments, communications and legal procedures. Tables are created for clients, suppliers, offers, purchase orders, delivery notes, receipts, invoices, payments and their relationships. Additional tables track communications, visits, legal cases and debt recovery documents and policies. Primary keys are defined and foreign key constraints are added to link tables together.

Uploaded by

CHOCo logo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

SQL Plus

The document contains SQL statements that create tables for an application that manages clients, suppliers, offers, purchase orders, delivery notes, invoices, payments, communications and legal procedures. Tables are created for clients, suppliers, offers, purchase orders, delivery notes, receipts, invoices, payments and their relationships. Additional tables track communications, visits, legal cases and debt recovery documents and policies. Primary keys are defined and foreign key constraints are added to link tables together.

Uploaded by

CHOCo logo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

CREATE TABLE Client (

id_client NUMBER PRIMARY KEY,


nom VARCHAR2(100),
adresse VARCHAR2(200),
email VARCHAR2(100),
telephone VARCHAR2(20)
);

CREATE TABLE Fournisseur (


id_fournisseur NUMBER PRIMARY KEY,
nom VARCHAR2(100),
adresse VARCHAR2(200),
email VARCHAR2(100),
telephone VARCHAR2(20),
);

CREATE TABLE Offre (


id_offre NUMBER PRIMARY KEY,
montant NUMBER,
date date,
valide boolean,
duree_de_validite interval
);

CREATE TABLE BonDeCommande (


id_bondecommande NUMBER PRIMARY KEY,
date_commande DATE
);

CREATE TABLE BonDeLivraison (


id_bondelivraison NUMBER PRIMARY KEY,
date_livraison DATE,
valide boolean
);

CREATE TABLE BonDeReception (


id_bondereception NUMBER PRIMARY KEY,
date_reception DATE,
valide boolean
);
CREATE TABLE Facture (
id_facture NUMBER PRIMARY KEY,
montant NUMBER,
date_facture DATE,
payee boolean,
echeance date
);

CREATE TABLE Paiement (


id_paiement NUMBER PRIMARY KEY,
montant NUMBER,
date DATE,
methode_paiement VARCHAR2(500),
numero_reference VARCHAR2(100),
statut_paiement boolean,
client_associee NUMBER,
facture_associee NUMBER,
remarques VARCHAR2(500),
FOREIGN KEY (client_associee) REFERENCES Client(id_client),
FOREIGN KEY (facture_associee) REFERENCES Facture(id_facture)
);

CREATE TABLE Email (


id_email NUMBER PRIMARY KEY,
date date,
client_associee NUMBER,
ordre NUMBER,
contenue string,
FOREIGN KEY (client_associe) REFERENCES Client(id_client)
);

CREATE TABLE AppelTelephonique(


id_appeltelephonique NUMBER PRIMARY KEY,
date date,
enregistrement,
client_associee NUMBER,
FOREIGN KEY (client_associe) REFERENCES Client(id_client)
);

CREATE TABLE visite (


id_visite NUMBER PRIMARY KEY,
client_associee int,
rapport VARCHAR2(500),
date date,
FOREIGN KEY (client_associe) REFERENCES Client(id_client)
);

CREATE TABLE ProcedureJuridiciaire (


id_procedurejuridiciair NUMBER PRIMARY KEY,
date date,
rapport VARCHAR2(500)
);

CREATE TABLE DossierDeRecouvrement (


id_dossierderecouvrement NUMBER PRIMARY KEY,
fournisseur NUMBER,
offre NUMBER,
bondecommande NUMBER,
bondelivraison NUMBER,
bondereception NUMBER,
facture NUMBER,
paiement NUMBER,
FOREIGN KEY (fournisseur) REFERENCES Fournisseur(id_fournisseur),
FOREIGN KEY (offre) REFERENCES Offre(id_offre),
FOREIGN KEY (bondecommande) REFERENCES BonDeCommande(id_bondecommande),
FOREIGN KEY (bondelivraison) REFERENCES BonDeLivraison(id_bondelivraison),
FOREIGN KEY (bondereception) REFERENCES BonDeReception(id_bondereception),
FOREIGN KEY (facture) REFERENCES Facture(id_facture),
FOREIGN KEY (paiement) REFERENCES Paiement(id_paiement)
);

CREATE TABLE PolitiqueDeRecouvrement (


id_politiquederecouvrement NUMBER PRIMARY KEY,
email NUMBER,
appeltelephonique NUMBER,
visite NUMBER,
procedurejuridiciaire NUMBER,
FOREIGN KEY (email) REFERENCES Email(id_email),
FOREIGN KEY (appeltelephonique) REFERENCES
AppelTelephonique(id_appeltelephonique),
FOREIGN KEY (visite) REFERENCES Visite(id_visite),
FOREIGN KEY (procedurejuridiciaire) REFERENCES
ProcedureJuridiciaire(id_procedurejuridiciaire)
);

You might also like