commit b57e4960f44f4c5e27948f79950ad520863d7e97 Author: noam.caronique Date: Sun Oct 12 20:07:54 2025 +0000 Ajouter Exercice_SQL.sql diff --git a/Exercice_SQL.sql b/Exercice_SQL.sql new file mode 100644 index 0000000..d3df6bc --- /dev/null +++ b/Exercice_SQL.sql @@ -0,0 +1,31 @@ +#exercice_1 +INSERT INTO Auteurs (nom, prenom) VALUES ('Dumas', 'Alexandre'); +INSERT INTO Auteurs (nom, prenom) VALUES ('J.K', 'Rowling'); + + +INSERT INTO Livres (titre, annee_publication, auteur_id ) VALUES ('Les Trois Mousquetaires', 1844, 15); +INSERT INTO Livres (titre, annee_publication, auteur_id ) VALUES ('Harry Potter à l\école des sorciers', 1997, 2); + + +#exercice_2 + +SELECT * FROM Livres WHERE annee_publication < 1900; + + +SELECT * FROM Auteurs WHERE prenom = 'Victor'; + +SELECT * FROM Livres WHERE titre LIKE '%PARIS%'; + + +#exercice_3 + +DELETE FROM Livres WHERE titre = 'Notre-Dame de Paris'; + +SELECT * FROM Livres WHERE titre = 'Notre-Dame de Paris'; + + +#exercice_4 + +SELECT * FROM Livres WHERE nom = 'Hugo'; + +SELECT * FROM Livres WHERE annee_publication < 1900 AND nom = 'Hugo'; \ No newline at end of file