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", "103", "Proposal C");
INSERT INTO "Documents" VALUES ("4", "104", "Letter D");
INSERT INTO "Documents" VALUES ("5", "105", "Article E");
INSERT INTO "Documents" VALUES ("6", "106", "Summary F");
INSERT INTO "Documents" VALUES ("7", "107", "Contract G");
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", "Memo B starts here.");
INSERT INTO "Paragraphs" VALUES ("5", "2", "Second paragraph of Memo B.");
INSERT INTO "Paragraphs" VALUES ("6", "3", "Proposal C introduction.");
INSERT INTO "Paragraphs" VALUES ("7", "3", "Proposal C details.");
INSERT INTO "Paragraphs" VALUES ("8", "3", "Proposal C conclusion.");
INSERT INTO "Paragraphs" VALUES ("9", "3", "Proposal C appendix.");
INSERT INTO "Paragraphs" VALUES ("10", "4", "Letter D content.");
INSERT INTO "Paragraphs" VALUES ("11", "5", "Article E first part.");
INSERT INTO "Paragraphs" VALUES ("12", "5", "Article E second part.");
INSERT INTO "Paragraphs" VALUES ("13", "5", "Article E third part.");
INSERT INTO "Paragraphs" VALUES ("14", "5", "Article E fourth part.");
INSERT INTO "Paragraphs" VALUES ("15", "6", "Summary F only paragraph.");
INSERT INTO "Paragraphs" VALUES ("16", "7", "Contract G clause 1.");
INSERT INTO "Paragraphs" VALUES ("17", "7", "Contract G clause 2.");