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 "Ref_Template_Types" (
"Template_Type_Code" CHAR(15),
"Template_Type_Description" VARCHAR(255),
PRIMARY KEY ("Template_Type_Code")
);

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", "102", "Document B");
INSERT INTO "Documents" VALUES ("3", "101", "Document C");
INSERT INTO "Documents" VALUES ("4", "103", "Document D");
INSERT INTO "Documents" VALUES ("5", "104", "Document E");
INSERT INTO "Documents" VALUES ("6", "102", "Document F");
INSERT INTO "Documents" VALUES ("7", "105", "Document G");
INSERT INTO "Documents" VALUES ("8", "101", "Document H");
INSERT INTO "Documents" VALUES ("9", "103", "Document I");
INSERT INTO "Documents" VALUES ("10", "104", "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 "Ref_Template_Types" VALUES ("GEN", "General Purpose Template");
INSERT INTO "Ref_Template_Types" VALUES ("FIN", "Financial Report Template");
INSERT INTO "Ref_Template_Types" VALUES ("LEG", "Legal Document Template");
INSERT INTO "Ref_Template_Types" VALUES ("HR", "Human Resources Template");
INSERT INTO "Ref_Template_Types" VALUES ("MKT", "Marketing Material Template");
INSERT INTO "Ref_Template_Types" VALUES ("TECH", "Technical Specification Template");
INSERT INTO "Ref_Template_Types" VALUES ("EDU", "Educational Content Template");
INSERT INTO "Ref_Template_Types" VALUES ("SALES", "Sales Proposal Template");
INSERT INTO "Ref_Template_Types" VALUES ("PROJ", "Project Management Template");
INSERT INTO "Ref_Template_Types" VALUES ("RES", "Research Paper Template");
INSERT INTO "Templates" VALUES ("101", "Details for General Purpose Template");
INSERT INTO "Templates" VALUES ("102", "Details for Financial Report Template");
INSERT INTO "Templates" VALUES ("103", "Details for Legal Document Template");
INSERT INTO "Templates" VALUES ("104", "Details for HR Template");
INSERT INTO "Templates" VALUES ("105", "Details for Marketing Material Template");
INSERT INTO "Templates" VALUES ("106", "Details for Technical Specification Template");
INSERT INTO "Templates" VALUES ("107", "Details for Educational Content Template");
INSERT INTO "Templates" VALUES ("108", "Details for Sales Proposal Template");
INSERT INTO "Templates" VALUES ("109", "Details for Project Management Template");
INSERT INTO "Templates" VALUES ("110", "Details for Research Paper Template");