Skip to content
Snippets Groups Projects
Commit c15fe028 authored by Joel Cavat's avatar Joel Cavat
Browse files

Exemple DI

parent 3d1b86f2
No related branches found
No related tags found
No related merge requests found
.mode column
.headers on
PRAGMA foreign_keys = ON;
PRAGMA strict = ON;
CREATE TABLE Livraison (
id_fourn INTEGER NOT NULL,
id_produit INTEGER NOT NULL,
PRIMARY KEY (id_fourn, id_produit)
);
INSERT INTO Livraison VALUES (1, 1), (1,2), (2,1), (3,4);
CREATE TABLE Achat (
id_achat INTEGER NOT NULL PRIMARY KEY,
id_fourn INTEGER NOT NULL,
id_produit INTEGER NOT NULL,
id_client INTEGER NOT NULL,
date TEXT,
FOREIGN KEY (id_fourn, id_produit) REFERENCES Livraison(id_fourn, id_produit)
);
INSERT INTO Achat VALUES (1,2,1,2, "2022");
-- INSERT INTO Achat VALUES (2,1,4,1, "2022");
INSERT INTO Achat VALUES (2,1,2,1, "2022");
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment