DEV_BUT1/tp3.txt
2023-04-04 14:03:16 +02:00

29 lines
938 B
Plaintext
Executable File

ALTER table Viticulteur add NumCav int references Cave_cooperative(NumCav);
INSERT into Cave_cooperative values(10, 'MACON', 1);
5)
INSERT INTO Viticulteur values(40, 'WEISS', 'JACQUES', 'COLMAR', NULL);
INSERT into Cave_cooperative values(12, 'STRASBOURG', 40);
UPDATE Viticulteur SET numcav = 12 where numvitic = 40;
Question 2
1)CREATE TABLE buveur2(NumBuveur int PRIMARY KEY, Nom Varchar(50), Prenom Varchar(50), Ville Varchar(50));
2)ALTER TABLE buveur2 DROP COLUMN VILLE;
3)CREATE TABLE Commande2(NumCom int PRIMARY KEY, NumBuveur int REFERENCES buveur2(NumBuveur), NumVin int REFERENCES Vin(NumVin), Qtte int, DateCom DATE);
4)ALTER TABLE buveur2 DROP COLUMN numbuveur;
Question 3
1)ALTER TABLE buveur2 MODIFY Nom VARCHAR(15);
2)ALTER TABLE buveur2 MODIFY Prenom VARCHAR(5);
3)ALTER TABLE buveur2 RENAME COLUMN Nom TO NomBuveur;
4)ALTER TABLE buveur2 RENAME COLUMN numBuveur TO idBuv;
5)