BEGIN TRANSACTION;
CREATE TABLE authors (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT NOT NULL,
    birth_year INTEGER
);
INSERT INTO "authors" VALUES(1,'Jane Austen',1775);
INSERT INTO "authors" VALUES(2,'Charles Dickens',1812);
INSERT INTO "authors" VALUES(3,'Leo Tolstoy',1828);
INSERT INTO "authors" VALUES(4,'Mark Twain',1835);
INSERT INTO "authors" VALUES(5,'Virginia Woolf',1882);
CREATE TABLE books (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    title TEXT NOT NULL,
    author_id INTEGER,
    published_year INTEGER,
    FOREIGN KEY(author_id) REFERENCES authors(id)
);
INSERT INTO "books" VALUES(1,'Pride and Prejudice',1,1813);
INSERT INTO "books" VALUES(2,'Great Expectations',2,1861);
INSERT INTO "books" VALUES(3,'War and Peace',3,1869);
INSERT INTO "books" VALUES(4,'Adventures of Huckleberry Finn',4,1884);
INSERT INTO "books" VALUES(5,'Mrs. Dalloway',5,1925);
DELETE FROM "sqlite_sequence";
INSERT INTO "sqlite_sequence" VALUES('authors',5);
INSERT INTO "sqlite_sequence" VALUES('books',5);
COMMIT;
