Insérer des données de livres :
Exécutez les commandes SQL suivantes pour insérer des exemples de données de livres dans la table book_search
:
INSERT INTO book_search (title, author, content) VALUES (
'The Lord of the Rings',
'J.R.R. Tolkien',
'A fantasy epic about hobbits, elves, and the battle against Sauron.'
);
INSERT INTO book_search (title, author, content) VALUES (
'Pride and Prejudice',
'Jane Austen',
'A classic novel about love, class, and society in 19th-century England.'
);
INSERT INTO book_search (title, author, content) VALUES (
'The Hitchhiker''s Guide to the Galaxy',
'Douglas Adams',
'A comedic science fiction series following the misadventures of Arthur Dent.'
);
INSERT INTO book_search (title, author, content) VALUES (
'To Kill a Mockingbird',
'Harper Lee',
'A powerful story about racial injustice in the American South.'
);
INSERT INTO book_search (title, author, content) VALUES (
'1984',
'George Orwell',
'A dystopian novel about totalitarianism and surveillance.'
);
Ces commandes insèrent cinq lignes dans la table book_search
, chacune représentant un livre. Les valeurs title
(titre), author
(auteur) et content
(contenu) sont fournies pour chaque livre. Notez l'apostrophe échappée dans 'The Hitchhiker''s Guide to the Galaxy'
. Les apostrophes à l'intérieur d'une chaîne de caractères doivent être échappées en les doublant.
Vérifier l'insertion des données :
Pour confirmer que les données ont été ajoutées correctement, exécutez la commande suivante :
SELECT * FROM book_search;
Cette commande récupère toutes les lignes et colonnes de la table book_search
. Vous devriez voir les données que vous venez d'insérer.
Résultat attendu :
The Lord of the Rings|J.R.R. Tolkien|A fantasy epic about hobbits, elves, and the battle against Sauron.
Pride and Prejudice|Jane Austen|A classic novel about love, class, and society in 19th-century England.
The Hitchhiker's Guide to the Galaxy|Douglas Adams|A comedic science fiction series following the misadventures of Arthur Dent.
To Kill a Mockingbird|Harper Lee|A powerful story about racial injustice in the American South.
1984|George Orwell|A dystopian novel about totalitarianism and surveillance.