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,
"Document_ID" INT,
"Paragraph_Text" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY ("Document_ID") REFERENCES "Documents"("Document_ID")
);

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





INSERT INTO "Templates" VALUES ("1", "Standard Business Letter");
INSERT INTO "Templates" VALUES ("2", "Marketing Brochure Template");
INSERT INTO "Templates" VALUES ("3", "Technical Report Template");
INSERT INTO "Templates" VALUES ("4", "Legal Contract Template");
INSERT INTO "Templates" VALUES ("5", "Meeting Minutes Template");
INSERT INTO "Documents" VALUES ("101", "1", "Client Welcome Letter");
INSERT INTO "Documents" VALUES ("102", "2", "Product Launch Brochure");
INSERT INTO "Documents" VALUES ("103", "3", "Annual Performance Report");
INSERT INTO "Documents" VALUES ("104", "1", "Follow-up Email");
INSERT INTO "Documents" VALUES ("105", "4", "Service Agreement");
INSERT INTO "Documents" VALUES ("106", "5", "Board Meeting Minutes");
INSERT INTO "Documents" VALUES ("107", "2", "Holiday Promotion Flyer");
INSERT INTO "Documents" VALUES ("108", "3", "Research Paper Draft");
INSERT INTO "Documents" VALUES ("109", "1", "Invoice Notification");
INSERT INTO "Documents" VALUES ("110", "4", "Non-Disclosure Agreement");
INSERT INTO "Documents" VALUES ("111", "1", "Empty Document Test");
INSERT INTO "Paragraphs" VALUES ("1", "101", "Dear Valued Client,");
INSERT INTO "Paragraphs" VALUES ("2", "101", "Welcome to our services. We are thrilled to have you on board.");
INSERT INTO "Paragraphs" VALUES ("3", "101", "We look forward to a successful partnership.");
INSERT INTO "Paragraphs" VALUES ("4", "102", "Introducing our revolutionary new product!");
INSERT INTO "Paragraphs" VALUES ("5", "102", "Experience unparalleled performance and features.");
INSERT INTO "Paragraphs" VALUES ("6", "102", "Available now for a limited time.");
INSERT INTO "Paragraphs" VALUES ("7", "103", "This report summarizes the annual performance.");
INSERT INTO "Paragraphs" VALUES ("8", "103", "Key achievements include significant growth in Q3.");
INSERT INTO "Paragraphs" VALUES ("9", "103", "Challenges were identified in market penetration.");
INSERT INTO "Paragraphs" VALUES ("10", "103", "Recommendations for future strategies are provided.");
INSERT INTO "Paragraphs" VALUES ("11", "104", "Following up on our recent conversation.");
INSERT INTO "Paragraphs" VALUES ("12", "105", "This Service Agreement is made between...");
INSERT INTO "Paragraphs" VALUES ("13", "105", "Terms and conditions apply.");
INSERT INTO "Paragraphs" VALUES ("14", "106", "Minutes of the Board Meeting held on...");
INSERT INTO "Paragraphs" VALUES ("15", "106", "Attendees: John Doe, Jane Smith, etc.");
INSERT INTO "Paragraphs" VALUES ("16", "106", "Key discussion points included budget approval.");
INSERT INTO "Paragraphs" VALUES ("17", "106", "Action items were assigned to relevant departments.");
INSERT INTO "Paragraphs" VALUES ("18", "107", "Get ready for our amazing holiday deals!");
INSERT INTO "Paragraphs" VALUES ("19", "108", "Introduction to the research topic.");
INSERT INTO "Paragraphs" VALUES ("20", "108", "Methodology used for data collection.");
INSERT INTO "Paragraphs" VALUES ("21", "108", "Preliminary findings suggest...");
INSERT INTO "Paragraphs" VALUES ("22", "109", "Your recent invoice is now available.");
INSERT INTO "Paragraphs" VALUES ("23", "110", "This Non-Disclosure Agreement NDA is entered into...");