PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "Documents" (
"Document_ID" INT UNIQUE,
"Template_ID" INT,
"Document_Name" VARCHAR(255),
PRIMARY KEY ("Document_ID")
);

CREATE TABLE "Paragraphs" (
"Paragraph_ID" INT,
"Document_ID" INT,
"Paragraph_Text" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY ("Document_ID") REFERENCES "Documents"("Document_ID")
);





INSERT INTO "Documents" VALUES ("1", "101", "Report A");
INSERT INTO "Documents" VALUES ("2", "102", "Memo B");
INSERT INTO "Documents" VALUES ("3", "101", "Report C");
INSERT INTO "Documents" VALUES ("4", "103", "Letter D");
INSERT INTO "Documents" VALUES ("5", "102", "Memo E");
INSERT INTO "Documents" VALUES ("6", "104", "Draft F");
INSERT INTO "Documents" VALUES ("7", "105", "Proposal G");
INSERT INTO "Documents" VALUES ("8", "101", "Report H");
INSERT INTO "Documents" VALUES ("9", "103", "Letter I");
INSERT INTO "Documents" VALUES ("10", "104", "Draft J");
INSERT INTO "Paragraphs" VALUES ("1", "1", "This is the first paragraph of Report A.");
INSERT INTO "Paragraphs" VALUES ("2", "1", "This is the second paragraph of Report A.");
INSERT INTO "Paragraphs" VALUES ("3", "1", "This is the third paragraph of Report A.");
INSERT INTO "Paragraphs" VALUES ("4", "2", "This is the only paragraph of Memo B.");
INSERT INTO "Paragraphs" VALUES ("5", "3", "This is the first paragraph of Report C.");
INSERT INTO "Paragraphs" VALUES ("6", "3", "This is the second paragraph of Report C.");
INSERT INTO "Paragraphs" VALUES ("7", "4", "This is the first paragraph of Letter D.");
INSERT INTO "Paragraphs" VALUES ("8", "4", "This is the second paragraph of Letter D.");
INSERT INTO "Paragraphs" VALUES ("9", "4", "This is the third paragraph of Letter D.");
INSERT INTO "Paragraphs" VALUES ("10", "4", "This is the fourth paragraph of Letter D.");
INSERT INTO "Paragraphs" VALUES ("11", "5", "This is the first paragraph of Memo E.");
INSERT INTO "Paragraphs" VALUES ("12", "5", "This is the second paragraph of Memo E.");
INSERT INTO "Paragraphs" VALUES ("13", "6", "This is the only paragraph of Draft F.");
INSERT INTO "Paragraphs" VALUES ("14", "7", "This is the first paragraph of Proposal G.");
INSERT INTO "Paragraphs" VALUES ("15", "7", "This is the second paragraph of Proposal G.");
INSERT INTO "Paragraphs" VALUES ("16", "7", "This is the third paragraph of Proposal G.");
INSERT INTO "Paragraphs" VALUES ("17", "8", "This is the first paragraph of Report H.");
INSERT INTO "Paragraphs" VALUES ("18", "9", "This is the only paragraph of Letter I.");
INSERT INTO "Paragraphs" VALUES ("19", "10", "This is the first paragraph of Draft J.");
INSERT INTO "Paragraphs" VALUES ("20", "10", "This is the second paragraph of Draft J.");