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", "Document A");
INSERT INTO "Documents" VALUES ("2", "102", "Document B");
INSERT INTO "Documents" VALUES ("3", "103", "Document C");
INSERT INTO "Documents" VALUES ("4", "104", "Document D");
INSERT INTO "Documents" VALUES ("5", "105", "Document E");
INSERT INTO "Documents" VALUES ("6", "106", "Document F");
INSERT INTO "Documents" VALUES ("7", "107", "Document G");
INSERT INTO "Paragraphs" VALUES ("1", "1", "This is the first paragraph of Document A.");
INSERT INTO "Paragraphs" VALUES ("2", "1", "This is the second paragraph of Document A.");
INSERT INTO "Paragraphs" VALUES ("3", "2", "This is the only paragraph of Document B.");
INSERT INTO "Paragraphs" VALUES ("4", "3", "Paragraph 1 for Document C.");
INSERT INTO "Paragraphs" VALUES ("5", "3", "Paragraph 2 for Document C.");
INSERT INTO "Paragraphs" VALUES ("6", "3", "Paragraph 3 for Document C.");
INSERT INTO "Paragraphs" VALUES ("7", "4", "The sole paragraph for Document D.");
INSERT INTO "Paragraphs" VALUES ("8", "5", "First paragraph of Document E.");
INSERT INTO "Paragraphs" VALUES ("9", "5", "Second paragraph of Document E.");
INSERT INTO "Paragraphs" VALUES ("10", "6", "Only paragraph for Document F.");
INSERT INTO "Paragraphs" VALUES ("11", "7", "Paragraph one for Document G.");
INSERT INTO "Paragraphs" VALUES ("12", "7", "Paragraph two for Document G.");
INSERT INTO "Paragraphs" VALUES ("13", "7", "Paragraph three for Document G.");
INSERT INTO "Paragraphs" VALUES ("14", "7", "Paragraph four for Document G.");