BEGIN TRANSACTION;
CREATE TABLE authors (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT NOT NULL
);
INSERT INTO "authors" VALUES(1,'Jane Austen');
INSERT INTO "authors" VALUES(2,'Mark Twain');
INSERT INTO "authors" VALUES(3,'J.K. Rowling');
INSERT INTO "authors" VALUES(4,'George Orwell');
INSERT INTO "authors" VALUES(5,'Leo Tolstoy');
CREATE TABLE books (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    title TEXT NOT NULL,
    author_id INTEGER,
    FOREIGN KEY(author_id) REFERENCES authors(id)
);
INSERT INTO "books" VALUES(1,'Pride and Prejudice',1);
INSERT INTO "books" VALUES(2,'Adventures of Huckleberry Finn',2);
INSERT INTO "books" VALUES(3,'Harry Potter and the Sorcerer''s Stone',3);
INSERT INTO "books" VALUES(4,'1984',4);
INSERT INTO "books" VALUES(5,'War and Peace',5);
DELETE FROM "sqlite_sequence";
INSERT INTO "sqlite_sequence" VALUES('authors',5);
INSERT INTO "sqlite_sequence" VALUES('books',5);
COMMIT;
