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"),
FOREIGN KEY ("Template_ID") REFERENCES "Templates"("Template_ID")
);

CREATE TABLE "Paragraphs" (
"Paragraph_ID" INT,
"Paragraph_Text" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID")
);

CREATE TABLE "Templates" (
"Template_ID" INT UNIQUE,
"Template_Details" VARCHAR(255),
PRIMARY KEY ("Template_ID")
);





INSERT INTO "Documents" VALUES ("1", "101", "Document A");
INSERT INTO "Documents" VALUES ("2", "101", "Document B");
INSERT INTO "Documents" VALUES ("3", "102", "Document C");
INSERT INTO "Documents" VALUES ("4", "103", "Document D");
INSERT INTO "Documents" VALUES ("5", "101", "Document E");
INSERT INTO "Documents" VALUES ("6", "104", "Document F");
INSERT INTO "Documents" VALUES ("7", "102", "Document G");
INSERT INTO "Documents" VALUES ("8", "105", "Document H");
INSERT INTO "Documents" VALUES ("9", "105", "Document I");
INSERT INTO "Documents" VALUES ("10", "106", "Document J");
INSERT INTO "Paragraphs" VALUES ("1", "This is paragraph 1.");
INSERT INTO "Paragraphs" VALUES ("2", "This is paragraph 2.");
INSERT INTO "Paragraphs" VALUES ("3", "This is paragraph 3.");
INSERT INTO "Paragraphs" VALUES ("4", "This is paragraph 4.");
INSERT INTO "Paragraphs" VALUES ("5", "This is paragraph 5.");
INSERT INTO "Paragraphs" VALUES ("6", "This is paragraph 6.");
INSERT INTO "Paragraphs" VALUES ("7", "This is paragraph 7.");
INSERT INTO "Paragraphs" VALUES ("8", "This is paragraph 8.");
INSERT INTO "Paragraphs" VALUES ("9", "This is paragraph 9.");
INSERT INTO "Paragraphs" VALUES ("10", "This is paragraph 10.");
INSERT INTO "Templates" VALUES ("101", "Standard Template");
INSERT INTO "Templates" VALUES ("102", "Marketing Template");
INSERT INTO "Templates" VALUES ("103", "Legal Template");
INSERT INTO "Templates" VALUES ("104", "HR Template");
INSERT INTO "Templates" VALUES ("105", "Financial Template");
INSERT INTO "Templates" VALUES ("106", "IT Template");
INSERT INTO "Templates" VALUES ("107", "Empty Template");