diff --git a/Code/TD1.db b/Code/TD1.db index 5379f65..69865f3 100644 Binary files a/Code/TD1.db and b/Code/TD1.db differ diff --git a/Code/TD1.db-journal b/Code/TD1.db-journal index 7f8f33d..5e1b37f 100644 Binary files a/Code/TD1.db-journal and b/Code/TD1.db-journal differ diff --git a/Code/TD2.db b/Code/TD2.db new file mode 100644 index 0000000..5379f65 Binary files /dev/null and b/Code/TD2.db differ diff --git a/Code/TD2.db-journal b/Code/TD2.db-journal new file mode 100644 index 0000000..d67b6df Binary files /dev/null and b/Code/TD2.db-journal differ diff --git a/Code/TD2.sql b/Code/TD2.sql index 69b3416..3fe72d9 100644 --- a/Code/TD2.sql +++ b/Code/TD2.sql @@ -34,3 +34,13 @@ INSERT INTO "Piece" ("numP","nomP","clrP","PdsP") VALUES (20,'Cle plate 24','Chr (34,'Boulon','Chrome',20); INSERT INTO "Livraison" ("numF","numP","Qte") VALUES (32,25,40); COMMIT; + + + +select Livraison.numP, nomP from Livraison, Piece +where Livraison.numP = Piece.numP + +-- num et nom des pieces qui contiennent "Cle plate" (dans leur nom) + +select numP, nomP from Piece +where nomP like "Cle plate%" \ No newline at end of file diff --git a/Code/TD2b.db b/Code/TD2b.db new file mode 100644 index 0000000..c7fc6e7 Binary files /dev/null and b/Code/TD2b.db differ diff --git a/Code/TD2b.sqbpro b/Code/TD2b.sqbpro new file mode 100644 index 0000000..7039ee9 --- /dev/null +++ b/Code/TD2b.sqbpro @@ -0,0 +1,2 @@ +
-- 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');