Inserir dados do livro:
Execute os seguintes comandos SQL para inserir dados de exemplo de livros na tabela 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.'
);
Esses comandos inserem cinco linhas na tabela book_search, cada uma representando um livro. Os valores de title, author e content são fornecidos para cada livro. Observe a aspa simples escapada em 'The Hitchhiker''s Guide to the Galaxy'. Aspas simples dentro de uma string devem ser escapadas dobrando-as.
Verificar a inserção de dados:
Para confirmar se os dados foram adicionados corretamente, execute o seguinte comando:
SELECT * FROM book_search;
Este comando recupera todas as linhas e colunas da tabela book_search. Você deve ver os dados que acabou de inserir.
Saída Esperada:
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.