From c3df27e4e5c698efb71247ff5e3bd92edb51611a Mon Sep 17 00:00:00 2001 From: pvalarcher Date: Thu, 14 Nov 2024 09:45:33 +0100 Subject: [PATCH] BD Vin --- Code/TD1.db | Bin 8192 -> 24576 bytes Code/TD1.db-journal | Bin 8720 -> 8720 bytes Code/TD2.db | Bin 0 -> 8192 bytes Code/TD2.db-journal | Bin 0 -> 8720 bytes Code/TD2.sql | 10 +++++++ Code/TD2b.db | Bin 0 -> 20480 bytes Code/TD2b.sqbpro | 2 ++ Code/TP1-BD-BUT1-sen.sql | 60 +++++++++++++++++++++++++++++++++++++++ Code/buveur.sql | 13 +++++++++ Code/commande.sql | 15 ++++++++++ Code/livraison.sql | 22 ++++++++++++++ Code/vin.sql | 20 +++++++++++++ Code/viticulteur.sql | 16 +++++++++++ 13 files changed, 158 insertions(+) create mode 100644 Code/TD2.db create mode 100644 Code/TD2.db-journal create mode 100644 Code/TD2b.db create mode 100644 Code/TD2b.sqbpro create mode 100644 Code/TP1-BD-BUT1-sen.sql create mode 100644 Code/buveur.sql create mode 100644 Code/commande.sql create mode 100644 Code/livraison.sql create mode 100644 Code/vin.sql create mode 100644 Code/viticulteur.sql diff --git a/Code/TD1.db b/Code/TD1.db index 5379f6594b4817485b32cf7eb6341d8cdf9f8525..69865f3871418660ffe0912ef019b01bb245f377 100644 GIT binary patch literal 24576 zcmeI$Z)?*)90%~b{rcG2k#9S^)#t3=de!AD4YT@I$(xQl?4Z}@uerk< z-r)}KwfQmYOs2|neP2#hBOYb{Zot{>Am6NBf4ih2Zt@^1N$sztR79!VES%b zRx@8Pd5sd+JCoo1FC)FB9EfQ!iTi^zuR$|yMw`h8(XxKe7ERNn;k&rRc;5JyTPZCL zEy}u0*jDaXs9BUxRLf*+vy+z7e$#U5FLo^*IvuG+h$kWY%uhdHh2>1q+}WX_h-Y82 zS!!liGFf`@5A(&{d^&gXX^S9T6rJ9QJGvdw+_$U?S~Rz}X}CAXkV-GMC+)>Evyw;> zjk4(JRagv4mWwSdmY%Aoagq^<(f+PwmGu%(;}_8<4hTR10uX=z1Rwwb2tWV=5P$## z)=8j5v!r?`RN#8^{r@#FuGgtR)B*trKmY;|fB*y_009U<00I!$V1Y+0PpZ`He-b0< zXKbNdf4={}BF5DQyP$LkKmY;|fB*y_009U<00Izzz}g5ruI5SYNk)1@B|R~eL%sW_ zjrsonh8Q<%Qz#0700bZa0SG_<0uX=z1Rwwb2tZ&iP^39ZDXZ4Ebe|f(i9T^a00Izz c00bZa0SG_<0uX=z1R$_(0tNj8pv0!7=40_>Syg(j<00RU6md%0!p8TFZva*bsC5cHn zsd@P&sksFul`xvgImp#9#8n~0(aFbE0Vb-Tk(r{9nOBmUo?4_(P?VXQSX8Nyom#26 MSuo%Q|HKIr0BGQoxC=2h083Ja63GcYhPZRBB50svoQ2SES; delta 21 TcmbQ>GQow10SRp6VNn7AB#Q!= diff --git a/Code/TD2.db b/Code/TD2.db new file mode 100644 index 0000000000000000000000000000000000000000..5379f6594b4817485b32cf7eb6341d8cdf9f8525 GIT binary patch literal 8192 zcmeIuy$ZrW48ZYRaTWUlg^aqm_yShxB3;yibH!5*?FYv#eJ>wS3l_R{mwzB6Bq77^ ze9T?2dT)GH2Hi+3#>iGxM50leUqAcSA^O==M6$jd=KWPHvUpFOvqt~{1Q0*~0R#|0 z009ILKmdV}K%OMVh4T8cbrWpWhHj|Q{*;g;fYMe+HT#;|B;ZF z4+8lmQBK0R#|0009ILKmY**5I_I{1R4TK7;5X%{l#2w&SZC2RBfljA6bJA-Cuv9^y%wc)ErwXGkP@jvq(H?;8abuVmeh@kDu(K4O>4=q!FEu^ z0x2u3EPR44h!4Pk#DbXl3M>proe&#$F$qpYmktco-;(Wj@9vy?KWDip8|y1hWb2Ro zpv@!w8kr!Jl3Th?2uX=EBhLOI<8;3v?lcjf6sE|P`*#ZCA4$4!MA(Dz&xND$*C!1| z9s&@600bZa0SG_<0uX=z1cX4Br?P6PL|;xu{Gn^FI8OuaguXWj(sj$MwM@NLTU;@9 zV~{uWaz1Bxop!^>Ew8oACDWRV6V0K-dSoZtO>23zW^L(r&8>1gdrsb(Mn%kS+_TK( zrL{z7MYqg`X_;$vb3->8ekbspFtj^?@sHu+Aw$EPj=f_W`ARiCrkW*69B6`?4=UQO4nnynJtw~(-3cYDsw(Y1@A34W*t?{LS>liClMD-Zz9=uZS+nZ5 zYgT#ws;t!5af5!+93-2&;n37kEKy*-(luySot>qJ=X*;^m?T1FczKDQlir&zU*yOl z>pU8MyPJ-i7*)L?OBr2cLoTu)>@w^vVc*$T_JO?pYC&{HpDCydv#o|Bmiu<^F$+xrBXVU)X#0hP@CC91ws21Rwwb2tWV=5P$##AOHaf zoLbL-3 zdOaTR%}kH>EW|wr+LY{35_4|GJ>*a;j&#lcc^r8q_x}p}LD)}m!2tmXKmY;|fB*y_ z009U<00Izzz!?z8DrrioGQFFnGSIbhUR0&9W5SNvuQN~}N`L?aAOHafKmY;|fB*y_ U009U
-- le nom des pièces qui n'ont pas été livrées +
diff --git a/Code/TP1-BD-BUT1-sen.sql b/Code/TP1-BD-BUT1-sen.sql new file mode 100644 index 0000000..3a0876c --- /dev/null +++ b/Code/TP1-BD-BUT1-sen.sql @@ -0,0 +1,60 @@ +drop table Buveur if exists; +drop table Viticulteur if exists; +drop table Vin if exists; +drop table Commande if exists; +drop table Livraison if exists; + +create table Buveur ( +NumBuveur number primary key, +Nom Varchar2(25), +Prenom Varchar2(25) +Ville Varchar2(30)); + + + +Create table Viticulteur ( + NumVitic Number Primary key, + Nom Varchar2(25) not null, + Prenom Varchar2(25), + Ville Varchar2 (30) not null ); + +Create table Vin ( + NumVin Number, + Cru Varchar2(15) not null, + Millesime Number not null, + Region Varchar2(15) not null, + NumVitic Number not null references Viticulteur, + Primary key (NumVin)); + +Create table Commande ( + NumCom Number Primary key, + NumBuveur Number not null references Buveur, + NumVin Number not null references Vin, + Qtte Number not null); + +Create table Livraison ( + NumCom Number not null references Commande, + Qtte Number not null, + DateLiv Date not null, + Primary key (NumCom, DateLiv)); + + +insert into buveur values (2300, 'Valarcher', 'Pierre', 'Pinet'); +delete from buveur where Numbuveur = 2300; + +Insert into buveur (select * from laleau.buveur); +Insert into Viticulteur (select * from laleau.viticulteur) +Insert into Vin (select * from laleau.vin); +-- on rajoute une colonne à la table commande (nom de l'attribut datecom, type date) +alter table commande add datecom date; +insert into commande (select * from laleau.commande) +insert into livraison (elect * from laleau.livraison) + +-- les tables sont remplies + +-- A vous de regarder dedans + +-- Avant de quitter faire +Commit; + + diff --git a/Code/buveur.sql b/Code/buveur.sql new file mode 100644 index 0000000..b9c25ae --- /dev/null +++ b/Code/buveur.sql @@ -0,0 +1,13 @@ +-------------------------------------------------------- +-- Fichier créé - jeudi-novembre-07-2024 +-------------------------------------------------------- +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1400','GAUTHIER','ROBERT','PARIS'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1500','FRADET','PHILIPPE','MACON'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1300','JAMET','FLORENCE','VERSAILLES'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1100','COMBET','ALINE','DIJON'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1600','DUPOND','ALAIN','PARIS'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1700','COMBES','EDOUARD','PARIS'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1350','GRAVINEL','SOPHIE','NICE'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1450','PASCAL','YVES','MACON'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1750','DURIEUX','BLAISE','CHINON'); +Insert into BUVEUR (NUMBUVEUR,NOM,PRENOM,VILLE) values ('1200','MAURY','FRANCOIS','PARIS'); diff --git a/Code/commande.sql b/Code/commande.sql new file mode 100644 index 0000000..b413fa6 --- /dev/null +++ b/Code/commande.sql @@ -0,0 +1,15 @@ +-------------------------------------------------------- +-- Fichier créé - jeudi-novembre-07-2024 +-------------------------------------------------------- + +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('8','1400','140','12',to_date('10/01/88','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('3','1500','88','24',to_date('10/09/87','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('2','1500','100','18',to_date('20/11/87','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('4','1600','175','6',to_date('12/02/87','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('5','1300','140','3',to_date('18/03/87','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('1','1600','90','6',to_date('10/06/87','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('6','1100','140','8',to_date('24/12/87','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('7','1200','88','3',to_date('24/12/87','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('11','1200','140','12',to_date('12/12/89','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('12','1100','120','6',to_date('13/12/89','DD/MM/RR')); +Insert into COMMANDE (NUMCOM,NUMBUVEUR,NUMVIN,QTTE,DATECOM) values ('10','1500','100','18',to_date('25/03/20','DD/MM/RR')); diff --git a/Code/livraison.sql b/Code/livraison.sql new file mode 100644 index 0000000..eebf168 --- /dev/null +++ b/Code/livraison.sql @@ -0,0 +1,22 @@ +-------------------------------------------------------- +-- Fichier créé - jeudi-novembre-07-2024 +-------------------------------------------------------- +-------------------------------------------------------- +-- DDL for Table LIVRAISON +-------------------------------------------------------- + + +insert into livraison (dateliv, qtte, numcom) values +(to_date('30/08/87', 'DD/MM/RR'), '12', '2'); +insert into livraison (dateliv, qtte, numcom) values +(to_date('15/07/87', 'DD/MM/RR'), '6', '1'); +insert into livraison (dateliv, qtte, numcom) values +(to_date('27/09/87', 'DD/MM/RR'), '6', '2'); +insert into livraison (dateliv, qtte, numcom) values +(to_date('20/11/87', 'DD/MM/RR'), '12', '3'); +insert into livraison (dateliv, qtte, numcom) values +(to_date('20/12/87', 'DD/MM/RR'), '6', '4'); +insert into livraison (dateliv, qtte, numcom) values +(to_date('28/12/87', 'DD/MM/RR'), '8', '6'); +insert into livraison (dateliv, qtte, numcom) values +(to_date('30/12/87', 'DD/MM/RR'), '3', '7'); diff --git a/Code/vin.sql b/Code/vin.sql new file mode 100644 index 0000000..c09a2d8 --- /dev/null +++ b/Code/vin.sql @@ -0,0 +1,20 @@ +-------------------------------------------------------- +-- Fichier créé - jeudi-novembre-07-2024 +-------------------------------------------------------- + +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('160','BOURGUEIL','1984','LOIRE','3'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('88','CHAMBERTIN','1980','BOURGOGNE','1'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('170','BOUZY','1984','CHAMPAGNE','15'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('175','MEURSAULT','1980','BOURGOGNE','16'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('80','SAUTERNES','1982','BORDEAUX','18'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('84','PAUILLAC','1982','BORDEAUX','21'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('90','MARGAUX','1978','BORDEAUX','22'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('98','MOULIS','1981','BORDEAUX','23'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('86','CHINON','1978','LOIRE','4'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('85','CHINON','1983','LOIRE','5'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('120','CHINON','1985','LOIRE','4'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('190','SAINT EMILION','1981','BORDEAUX','18'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('128','BOURGUEIL','1985','LOIRE','4'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('140','POMMARD','1976','BOURGOGNE','10'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('150','MONTHELIE','1978','BOURGOGNE','10'); +Insert into VIN (NUMVIN,CRU,MILLESIME,REGION,NUMVITIC) values ('100','CHAMPAGNE BRUT','1988','CHAMPAGNE','15'); diff --git a/Code/viticulteur.sql b/Code/viticulteur.sql new file mode 100644 index 0000000..5922356 --- /dev/null +++ b/Code/viticulteur.sql @@ -0,0 +1,16 @@ +-------------------------------------------------------- +-- Fichier créé - jeudi-novembre-07-2024 +-------------------------------------------------------- + +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('1','MOULIN','JEAN','MACON'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('3','MORIN','JULES','BENAIS'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('5','COULIS DUTHEIL',null,'CHINON'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('4','VALLEE','CLAUDE','SAINT NICOLAS'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('10','PARENT','PIERRE','POMMARD'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('15','BARANCOURT',null,'TOURS SUR MARNE'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('16','JADOT','LOUIS','BEAUNE'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('18','MEDEVILLE','CHARLES','PREIGNAC'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('21','LYNCH-BAGES',null,'PAUILLAC'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('22','CHATEAU MONBRISON',null,'MARGAUX'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('23','CHATEAU MOULIN A VENT',null,'CASTELNAU DE MEDOC'); +Insert into VITICULTEUR (NUMVITIC,NOM,PRENOM,VILLE) values ('20','TISSOT','JACQUES','ARBOIS');