-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbdd.sql
1387 lines (918 loc) · 33.2 KB
/
bdd.sql
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: postgres; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON DATABASE postgres IS 'default administrative connection database';
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: adminpack; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS adminpack WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION adminpack; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION adminpack IS 'administrative functions for PostgreSQL';
SET search_path = public, pg_catalog;
--
-- Name: fonction; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE fonction AS ENUM (
'com',
'tech'
);
ALTER TYPE public.fonction OWNER TO postgres;
--
-- Name: type; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE type AS ENUM (
'rep',
'ent'
);
ALTER TYPE public.type OWNER TO postgres;
--
-- Name: check_entreprise_entretien(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION check_entreprise_entretien() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE ent type;
BEGIN
SELECT type INTO ent
FROM ENTREPRISE;
IF ent != 'entretien' THEN
RAISE EXCEPTION 'mauvaise entreprise';
END IF;
END;
$$;
ALTER FUNCTION public.check_entreprise_entretien() OWNER TO postgres;
--
-- Name: check_entreprise_rep(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION check_entreprise_rep() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE ent type;
BEGIN
SELECT type INTO ent
FROM ENTREPRISE;
IF ent != 'reparation' THEN
RAISE EXCEPTION 'mauvaise entreprise';
END IF;
END;
$$;
ALTER FUNCTION public.check_entreprise_rep() OWNER TO postgres;
--
-- Name: checkid_com(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION checkid_com() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE fu fonction;
BEGIN
SELECT function INTO fu
FROM EMPLOYE;
IF fu != 'com' THEN
RAISE EXCEPTION 'id-employe mauvais';
END IF;
END;
$$;
ALTER FUNCTION public.checkid_com() OWNER TO postgres;
--
-- Name: checkid_combis(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION checkid_combis() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE fu fonction;
BEGIN
SELECT function INTO fu
FROM EMPLOYE;
IF fu != 'tech' THEN
RAISE EXCEPTION 'id-employe mauvais';
END IF;
END;
$$;
ALTER FUNCTION public.checkid_combis() OWNER TO postgres;
--
-- Name: checkid_tech(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION checkid_tech() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE fu fonction;
BEGIN
SELECT function INTO fu
FROM EMPLOYE;
IF fu != 'tech' THEN
RAISE EXCEPTION 'id-employe mauvais';
END IF;
END;
$$;
ALTER FUNCTION public.checkid_tech() OWNER TO postgres;
--
-- Name: verif_contrat_loc(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION verif_contrat_loc() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF NEW.function != 'tech' THEN
RAISE EXCEPTION 'id-employe mauvais';
END IF;
END;
$$;
ALTER FUNCTION public.verif_contrat_loc() OWNER TO postgres;
--
-- Name: verif_contrat_locbis(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION verif_contrat_locbis() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF EMPLOYE.function != 'tech' THEN
RAISE EXCEPTION 'id-employe mauvais';
END IF;
END;
$$;
ALTER FUNCTION public.verif_contrat_locbis() OWNER TO postgres;
--
-- Name: verif_loc(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION verif_loc() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF NEW.function != tech THEN
RAISE EXCEPTION 'id-employe mauvais';
END IF;
END;
$$;
ALTER FUNCTION public.verif_loc() OWNER TO postgres;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: agence; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE agence (
nom_agence character varying(25) NOT NULL
);
ALTER TABLE public.agence OWNER TO postgres;
--
-- Name: apparaitre; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE apparaitre (
id_conducteur integer NOT NULL,
id_liste integer NOT NULL
);
ALTER TABLE public.apparaitre OWNER TO postgres;
--
-- Name: categorie; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE categorie (
nom_categorie character varying(10) NOT NULL
);
ALTER TABLE public.categorie OWNER TO postgres;
--
-- Name: client; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE client (
id_client integer NOT NULL,
date_inscription timestamp without time zone,
password_gestion_compte character varying(25)
);
ALTER TABLE public.client OWNER TO postgres;
--
-- Name: comporter; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE comporter (
numero_immatriculation character varying(10) NOT NULL,
nom_option character varying(25)
);
ALTER TABLE public.comporter OWNER TO postgres;
--
-- Name: conducteur; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE conducteur (
id_conducteur integer NOT NULL,
nom character varying(25),
prenom character varying(25),
copie_permis integer
);
ALTER TABLE public.conducteur OWNER TO postgres;
--
-- Name: contrat_de_location; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE contrat_de_location (
num_contrat integer NOT NULL,
date_debut_loc timestamp without time zone,
date_fin_loc timestamp without time zone,
degats_eventuels_initiaux text,
km_initial integer,
niveau_carb_initial integer,
seuil_km integer,
cb_presentee boolean,
id_employe integer NOT NULL,
id_facture integer NOT NULL
);
ALTER TABLE public.contrat_de_location OWNER TO postgres;
--
-- Name: editer; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE editer (
id_employe integer NOT NULL,
id_facture integer NOT NULL
);
ALTER TABLE public.editer OWNER TO postgres;
--
-- Name: employe; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE employe (
id_employe integer NOT NULL,
nom_agence character varying(25) NOT NULL,
function fonction
);
ALTER TABLE public.employe OWNER TO postgres;
--
-- Name: entreprise; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE entreprise (
nom_entreprise character varying(25) NOT NULL,
type type,
nom_agence character varying(25)
);
ALTER TABLE public.entreprise OWNER TO postgres;
--
-- Name: entretien; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE entretien (
id_entretien integer NOT NULL,
prix real,
numero_immatriculation character varying(10),
nom_entreprise character varying(25)
);
ALTER TABLE public.entretien OWNER TO postgres;
--
-- Name: facture; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE facture (
id_facture integer NOT NULL,
date_reglement timestamp without time zone,
montant real,
moyen_de_paiement character varying(25)
);
ALTER TABLE public.facture OWNER TO postgres;
--
-- Name: faire_appel; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE faire_appel (
nom_agence character varying(25) NOT NULL,
nom_entreprise character varying(25) NOT NULL
);
ALTER TABLE public.faire_appel OWNER TO postgres;
--
-- Name: gerer; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE gerer (
id_employe integer NOT NULL,
id_location integer NOT NULL,
validation_finale_isdone boolean
);
ALTER TABLE public.gerer OWNER TO postgres;
--
-- Name: gerer_parc; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE gerer_parc (
id_employe integer NOT NULL,
numero_immatriculation character varying(10) NOT NULL
);
ALTER TABLE public.gerer_parc OWNER TO postgres;
--
-- Name: liste_conducteurs; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE liste_conducteurs (
id_liste integer NOT NULL,
id_pro integer NOT NULL,
id_location integer NOT NULL
);
ALTER TABLE public.liste_conducteurs OWNER TO postgres;
--
-- Name: location; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE location (
id_location integer NOT NULL,
id_client integer NOT NULL,
num_contrat integer NOT NULL,
numero_immatriculation character varying(10) NOT NULL
);
ALTER TABLE public.location OWNER TO postgres;
--
-- Name: modele; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE modele (
nom_modele character varying(25) NOT NULL,
nom_categorie character varying(10) NOT NULL,
nb_portes integer NOT NULL,
boite_vitesse character varying(7) NOT NULL,
puissance_fiscale integer,
carburant character varying(10),
taille integer
);
ALTER TABLE public.modele OWNER TO postgres;
--
-- Name: option; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE option (
nom_option character varying(25) NOT NULL
);
ALTER TABLE public.option OWNER TO postgres;
--
-- Name: particulier; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE particulier (
id_part integer NOT NULL,
contrat_en_cours boolean,
nom character varying(25) NOT NULL,
prenom character varying(25) NOT NULL,
adresse text NOT NULL,
ville character varying(25) NOT NULL,
date_naissance date NOT NULL,
numero_tel integer NOT NULL,
copie_permis integer NOT NULL
);
ALTER TABLE public.particulier OWNER TO postgres;
--
-- Name: professionnel; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE professionnel (
id_pro integer NOT NULL,
nom_entreprise character varying(25)
);
ALTER TABLE public.professionnel OWNER TO postgres;
--
-- Name: reparation; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE reparation (
id_reparation integer NOT NULL,
prix real,
nbr_jour_reparation integer,
numero_immatriculation character varying(10),
nom_entreprise character varying(25)
);
ALTER TABLE public.reparation OWNER TO postgres;
--
-- Name: supervise_entretien; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE supervise_entretien (
id_employe integer NOT NULL,
id_entretien integer NOT NULL
);
ALTER TABLE public.supervise_entretien OWNER TO postgres;
--
-- Name: supervise_reparation; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE supervise_reparation (
id_employe integer NOT NULL,
id_reparation integer NOT NULL
);
ALTER TABLE public.supervise_reparation OWNER TO postgres;
--
-- Name: vcommercial; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW vcommercial AS
SELECT employe.id_employe,
employe.nom_agence,
employe.function
FROM employe
WHERE (employe.function = 'com'::fonction);
ALTER TABLE public.vcommercial OWNER TO postgres;
--
-- Name: vehicule; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE vehicule (
numero_immatriculation character varying(10) NOT NULL,
nom_modele character varying(25),
nom_categorie character varying(25),
nom_agence character varying(25) NOT NULL,
marque character varying(25) NOT NULL,
date_mise_en_circulation timestamp without time zone,
degats_eventuels text,
km integer,
niveau_carb integer,
couleur character varying(25),
est_loue boolean
);
ALTER TABLE public.vehicule OWNER TO postgres;
--
-- Name: vsociete_entretien; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW vsociete_entretien AS
SELECT entreprise.nom_entreprise,
entreprise.type,
entreprise.nom_agence
FROM entreprise
WHERE (entreprise.type = 'ent'::type);
ALTER TABLE public.vsociete_entretien OWNER TO postgres;
--
-- Name: vsociete_reparation; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW vsociete_reparation AS
SELECT entreprise.nom_entreprise,
entreprise.type,
entreprise.nom_agence
FROM entreprise
WHERE (entreprise.type = 'rep'::type);
ALTER TABLE public.vsociete_reparation OWNER TO postgres;
--
-- Name: vtechnique; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW vtechnique AS
SELECT employe.id_employe,
employe.nom_agence,
employe.function
FROM employe
WHERE (employe.function = 'tech'::fonction);
ALTER TABLE public.vtechnique OWNER TO postgres;
--
-- Data for Name: agence; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY agence (nom_agence) FROM stdin;
FRANCECAR
\.
--
-- Data for Name: apparaitre; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY apparaitre (id_conducteur, id_liste) FROM stdin;
\.
--
-- Data for Name: categorie; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY categorie (nom_categorie) FROM stdin;
\.
--
-- Data for Name: client; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY client (id_client, date_inscription, password_gestion_compte) FROM stdin;
\.
--
-- Data for Name: comporter; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY comporter (numero_immatriculation, nom_option) FROM stdin;
\.
--
-- Data for Name: conducteur; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY conducteur (id_conducteur, nom, prenom, copie_permis) FROM stdin;
\.
--
-- Data for Name: contrat_de_location; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY contrat_de_location (num_contrat, date_debut_loc, date_fin_loc, degats_eventuels_initiaux, km_initial, niveau_carb_initial, seuil_km, cb_presentee, id_employe, id_facture) FROM stdin;
\.
--
-- Data for Name: editer; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY editer (id_employe, id_facture) FROM stdin;
\.
--
-- Data for Name: employe; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY employe (id_employe, nom_agence, function) FROM stdin;
1 FRANCECAR com
\.
--
-- Data for Name: entreprise; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY entreprise (nom_entreprise, type, nom_agence) FROM stdin;
\.
--
-- Data for Name: entretien; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY entretien (id_entretien, prix, numero_immatriculation, nom_entreprise) FROM stdin;
\.
--
-- Data for Name: facture; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY facture (id_facture, date_reglement, montant, moyen_de_paiement) FROM stdin;
1 2014-01-23 09:45:09 200 cb
\.
--
-- Data for Name: faire_appel; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY faire_appel (nom_agence, nom_entreprise) FROM stdin;
\.
--
-- Data for Name: gerer; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY gerer (id_employe, id_location, validation_finale_isdone) FROM stdin;
\.
--
-- Data for Name: gerer_parc; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY gerer_parc (id_employe, numero_immatriculation) FROM stdin;
\.
--
-- Data for Name: liste_conducteurs; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY liste_conducteurs (id_liste, id_pro, id_location) FROM stdin;
\.
--
-- Data for Name: location; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY location (id_location, id_client, num_contrat, numero_immatriculation) FROM stdin;
\.
--
-- Data for Name: modele; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY modele (nom_modele, nom_categorie, nb_portes, boite_vitesse, puissance_fiscale, carburant, taille) FROM stdin;
\.
--
-- Data for Name: option; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY option (nom_option) FROM stdin;
\.
--
-- Data for Name: particulier; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY particulier (id_part, contrat_en_cours, nom, prenom, adresse, ville, date_naissance, numero_tel, copie_permis) FROM stdin;
\.
--
-- Data for Name: professionnel; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY professionnel (id_pro, nom_entreprise) FROM stdin;
\.
--
-- Data for Name: reparation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY reparation (id_reparation, prix, nbr_jour_reparation, numero_immatriculation, nom_entreprise) FROM stdin;
\.
--
-- Data for Name: supervise_entretien; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY supervise_entretien (id_employe, id_entretien) FROM stdin;
\.
--
-- Data for Name: supervise_reparation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY supervise_reparation (id_employe, id_reparation) FROM stdin;
\.
--
-- Data for Name: vehicule; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY vehicule (numero_immatriculation, nom_modele, nom_categorie, nom_agence, marque, date_mise_en_circulation, degats_eventuels, km, niveau_carb, couleur, est_loue) FROM stdin;
\.
--
-- Name: agence_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY agence
ADD CONSTRAINT agence_pkey PRIMARY KEY (nom_agence);
--
-- Name: apparaitre_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY apparaitre
ADD CONSTRAINT apparaitre_pkey PRIMARY KEY (id_conducteur, id_liste);
--
-- Name: categorie_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY categorie
ADD CONSTRAINT categorie_pkey PRIMARY KEY (nom_categorie);
--
-- Name: client_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY client
ADD CONSTRAINT client_pkey PRIMARY KEY (id_client);
--
-- Name: comporter_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY comporter
ADD CONSTRAINT comporter_pkey PRIMARY KEY (numero_immatriculation);
--
-- Name: conducteur_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY conducteur
ADD CONSTRAINT conducteur_pkey PRIMARY KEY (id_conducteur);
--
-- Name: contrat_de_location_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY contrat_de_location
ADD CONSTRAINT contrat_de_location_pkey PRIMARY KEY (num_contrat);
--
-- Name: editer_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY editer
ADD CONSTRAINT editer_pkey PRIMARY KEY (id_employe, id_facture);
--
-- Name: employe_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY employe
ADD CONSTRAINT employe_pkey PRIMARY KEY (id_employe);
--
-- Name: entreprise_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY entreprise
ADD CONSTRAINT entreprise_pkey PRIMARY KEY (nom_entreprise);
--
-- Name: entretien_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY entretien
ADD CONSTRAINT entretien_pkey PRIMARY KEY (id_entretien);
--
-- Name: facture_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY facture
ADD CONSTRAINT facture_pkey PRIMARY KEY (id_facture);
--
-- Name: faire_appel_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY faire_appel
ADD CONSTRAINT faire_appel_pkey PRIMARY KEY (nom_agence, nom_entreprise);
--
-- Name: gerer_parc_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY gerer_parc
ADD CONSTRAINT gerer_parc_pkey PRIMARY KEY (id_employe, numero_immatriculation);
--
-- Name: gerer_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY gerer
ADD CONSTRAINT gerer_pkey PRIMARY KEY (id_employe, id_location);
--
-- Name: liste_conducteurs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY liste_conducteurs
ADD CONSTRAINT liste_conducteurs_pkey PRIMARY KEY (id_liste);
--
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY location
ADD CONSTRAINT location_pkey PRIMARY KEY (id_location);
--
-- Name: modele_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY modele
ADD CONSTRAINT modele_pkey PRIMARY KEY (nom_modele);
--
-- Name: option_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY option
ADD CONSTRAINT option_pkey PRIMARY KEY (nom_option);
--
-- Name: particulier_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY particulier
ADD CONSTRAINT particulier_pkey PRIMARY KEY (id_part);
--
-- Name: professionnel_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: