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", "Article F");
INSERT INTO "Documents" VALUES ("7", "101", "Report G");
INSERT INTO "Documents" VALUES ("8", "105", "Proposal H");
INSERT INTO "Documents" VALUES ("9", "103", "Letter I");
INSERT INTO "Documents" VALUES ("10", "104", "Article 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", "5", "This is the first paragraph of Memo E.");
INSERT INTO "Paragraphs" VALUES ("9", "5", "This is the second paragraph of Memo E.");
INSERT INTO "Paragraphs" VALUES ("10", "6", "This is the first paragraph of Article F.");
INSERT INTO "Paragraphs" VALUES ("11", "7", "This is the first paragraph of Report G.");
INSERT INTO "Paragraphs" VALUES ("12", "7", "This is the second paragraph of Report G.");
INSERT INTO "Paragraphs" VALUES ("13", "7", "This is the third paragraph of Report G.");
INSERT INTO "Paragraphs" VALUES ("14", "7", "This is the fourth paragraph of Report G.");
INSERT INTO "Paragraphs" VALUES ("15", "8", "This is the only paragraph of Proposal H.");
INSERT INTO "Paragraphs" VALUES ("16", "9", "This is the first paragraph of Letter I.");
INSERT INTO "Paragraphs" VALUES ("17", "9", "This is the second paragraph of Letter I.");
INSERT INTO "Paragraphs" VALUES ("18", "10", "This is the first paragraph of Article J.");
INSERT INTO "Paragraphs" VALUES ("19", "10", "This is the second paragraph of Article J.");
INSERT INTO "Paragraphs" VALUES ("20", "10", "This is the third paragraph of Article J.");