BD Vin
This commit is contained in:
parent
b7ee8bb294
commit
c3df27e4e5
BIN
Code/TD1.db
BIN
Code/TD1.db
Binary file not shown.
Binary file not shown.
BIN
Code/TD2.db
Normal file
BIN
Code/TD2.db
Normal file
Binary file not shown.
BIN
Code/TD2.db-journal
Normal file
BIN
Code/TD2.db-journal
Normal file
Binary file not shown.
10
Code/TD2.sql
10
Code/TD2.sql
@ -34,3 +34,13 @@ INSERT INTO "Piece" ("numP","nomP","clrP","PdsP") VALUES (20,'Cle plate 24','Chr
|
|||||||
(34,'Boulon','Chrome',20);
|
(34,'Boulon','Chrome',20);
|
||||||
INSERT INTO "Livraison" ("numF","numP","Qte") VALUES (32,25,40);
|
INSERT INTO "Livraison" ("numF","numP","Qte") VALUES (32,25,40);
|
||||||
COMMIT;
|
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%"
|
BIN
Code/TD2b.db
Normal file
BIN
Code/TD2b.db
Normal file
Binary file not shown.
2
Code/TD2b.sqbpro
Normal file
2
Code/TD2b.sqbpro
Normal file
File diff suppressed because one or more lines are too long
60
Code/TP1-BD-BUT1-sen.sql
Normal file
60
Code/TP1-BD-BUT1-sen.sql
Normal file
@ -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;
|
||||||
|
|
||||||
|
|
13
Code/buveur.sql
Normal file
13
Code/buveur.sql
Normal file
@ -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');
|
15
Code/commande.sql
Normal file
15
Code/commande.sql
Normal file
@ -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'));
|
22
Code/livraison.sql
Normal file
22
Code/livraison.sql
Normal file
@ -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');
|
20
Code/vin.sql
Normal file
20
Code/vin.sql
Normal file
@ -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');
|
16
Code/viticulteur.sql
Normal file
16
Code/viticulteur.sql
Normal file
@ -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');
|
Loading…
Reference in New Issue
Block a user