| Book Id | Title | Author | Publication Year | Genre | Target Age | Isbn |
|---|---|---|---|---|---|---|
| 1 | Charlotte's Web | E.B. White | 1952 | Fiction | 8-12 | 9780064400558 |
| 2 | The Cat in the Hat | Dr. Seuss | 1957 | Fiction | 4-8 | 9780394800011 |
| 3 | Winnie-the-Pooh | A.A. Milne | 1926 | Fiction | 6-10 | 9780142404676 |
| 5 | Where the Wild Things Are | Maurice Sendak | 1963 | Fiction | 4-8 | 9780064431781 |
| 57 | The Lion, the Witch and the Wardrobe | C.S. Lewis | 1950 | Fantasy | 8-12 | 8888888888888 |
Look in the controllers/sqlite/crud-demo.js and models/sqlite.js for how the SELECT, INSERT, UPDATE, and DELETE were done.
-- TO MAKE SAMPLE DATABASE AND TABLE IN SQLITE
-- SQLite automatically creates the database file when you connect to it
-- No explicit CREATE DATABASE command is needed
-- Create the books table
CREATE TABLE books (
book_id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
author TEXT NOT NULL,
publication_year INTEGER NOT NULL,
genre TEXT,
target_age TEXT,
isbn TEXT
);
-- Insert 5 famous children's books published before 1968
INSERT INTO books (title, author, publication_year, genre, target_age, isbn) VALUES
('Charlotte''s Web', 'E.B. White', 1952, 'Fiction', '8-12', '9780064400558'),
('The Cat in the Hat', 'Dr. Seuss', 1957, 'Fiction', '4-8', '9780394800011'),
('Winnie-the-Pooh', 'A.A. Milne', 1926, 'Fiction', '6-10', '9780142404676'),
('The Lion, the Witch and the Wardrobe', 'C.S. Lewis', 1950, 'Fantasy', '8-12', '9780064404990'),
('Where the Wild Things Are', 'Maurice Sendak', 1963, 'Fiction', '4-8', '9780064431781');