transport

This commit is contained in:
2025-09-20 13:55:46 +02:00
parent 4b8a242dda
commit 5c0d91a0ba
5 changed files with 109 additions and 197 deletions

61
transport/initdb.sql Normal file
View File

@@ -0,0 +1,61 @@
-- La table société
create table societe (
id integer primary key,
nom text
);
-- La table chauffeur
create table chauffeur (
id integer primary key,
nom text
);
-- La table entrepot
create table entrepot (
id integer primary key,
ville text
);
-- La table camion
create table camion (
immatriculation text primary key,
marque text,
capacite numeric,
permis text,
foreign key (permis) references permis(categorie)
);
-- La table permis
create table permis (
categorie text primary key,
poids_maximum numeric
);
create table examen (
numero integer primary key,
date text,
permis text,
chauffeur_id integer,
foreign key (chauffeur_id)
references chauffeur(id),
foreign key (permis)
references permis(categorie)
);
create table transport (
id integer primary key,
jour text,
camion_immatriculation text,
chauffeur_id integer,
entrepot_depart_id integer,
entrepot_arrivee_id integer,
foreign key (chauffeur_id)
references chauffeur(id),
foreign key (camion_immatriculation)
references camion(immatriculation),
foreign key (entrepot_depart_id)
references entrepot(id),
foreign key (entrepot_arrivee_id)
references entrepot(id)
)