Vous êtes sur la page 1sur 1

"CREATE TABLE IF NOT EXISTS encheres ( id INTEGER PRIMARY KEY AUTOINCREMENT,\

id_appareil_photo INTEGER,\
id_utilisateur INTEGER,\
prix_propose REAL,\
date_enchere TEXT,\
statut TEXT,\
FOREIGN KEY(id_appareilphoto) REFERENCES appareilsphoto(id),\
FOREIGN KEY(id_utilisateur) REFERENCES utilisateurs(id)) ;"
"CREATE TABLE IF NOT EXISTS lieux_de_vente ( id INTEGER PRIMARY KEY\
adresse TEXT,\
telephone TEXT,\
url_site_web TEXT) ;"
"CREATE TABLE IF NOT EXISTS prix ( id INTEGER PRIMARY KEY AUTOINCREMENT,\
id_appareil_photo INTEGER,\
id_lieu_de_vente INTEGER,\
prix REAL,\
date_prix TEXT,\
FOREIGN KEY(id_appareilphoto) REFERENCES appareilphoto(id),\
FOREIGN KEY(id_lieu_de_vente) REFERENCES lieux_de_vente(id)) ; ",

"INSERT INTO encheres (id_appareil_photo, id_utilisateur, prix_propose,


date_enchere, statut) VALUES (1, 1, '1200.00', '2022-04-28 10:00:00', 'en_cours'),\
(2, 2, '1600.00', '2022-04-28 10:00:00', 'en_cours'); "
"INSERT INTO lieux_de_vente (id, adresse, telephone,
url_site_web) VALUES (1, '123 Rue de la Paix, Paris', '01 23 45 67 89',
'www.magasindephoto.com'),\
(2, '456 Boulevard des Batignolles, Paris', '01 34 56 78 90',
'www.magasindecamera.com'),\
(3, '789 Avenue des Ternes, Paris', '01 45 67 89 01',
'www.magasindappareilphoto.com'); "
"INSERT INTO prix (id, id_appareil_photo, id_lieu_de_vente,
prix, date_prix) VALUES (1, 1, 1, '1299.99', '2022-04-28'),\
(2, 2, 1, '1699.99', '2022-04-28'),(3, 3, 2, '1999.99', '2022-04-28') ; ",

Vous aimerez peut-être aussi