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

CREATE TABLE "Templates" (
"Template_ID" INT UNIQUE,
"Template_Type_Code" CHAR(15),
PRIMARY KEY ("Template_ID"),
FOREIGN KEY ("Template_Type_Code") REFERENCES "Ref_Template_Types"("Template_Type_Code")
);





INSERT INTO "Ref_Template_Types" VALUES ("DOC", "Document Template");
INSERT INTO "Ref_Template_Types" VALUES ("PPT", "Presentation Template");
INSERT INTO "Ref_Template_Types" VALUES ("XLS", "Spreadsheet Template");
INSERT INTO "Ref_Template_Types" VALUES ("TXT", "Text File Template");
INSERT INTO "Ref_Template_Types" VALUES ("PDF", "Portable Document Format Template");
INSERT INTO "Templates" VALUES ("101", "DOC");
INSERT INTO "Templates" VALUES ("102", "PPT");
INSERT INTO "Templates" VALUES ("103", "XLS");
INSERT INTO "Templates" VALUES ("104", "DOC");
INSERT INTO "Templates" VALUES ("105", "PPT");
INSERT INTO "Templates" VALUES ("106", "TXT");
INSERT INTO "Templates" VALUES ("107", "PPT");
INSERT INTO "Templates" VALUES ("108", "DOC");
INSERT INTO "Templates" VALUES ("109", "PDF");
INSERT INTO "Templates" VALUES ("110", "PPT");
INSERT INTO "Documents" VALUES ("1", "101", "Meeting Minutes Q1");
INSERT INTO "Documents" VALUES ("2", "102", "Sales Presentation Q2");
INSERT INTO "Documents" VALUES ("3", "103", "Budget Report 2023");
INSERT INTO "Documents" VALUES ("4", "104", "Project Proposal Alpha");
INSERT INTO "Documents" VALUES ("5", "105", "Marketing Strategy Deck");
INSERT INTO "Documents" VALUES ("6", "101", "Employee Handbook");
INSERT INTO "Documents" VALUES ("7", "102", "Investor Briefing");
INSERT INTO "Documents" VALUES ("8", "106", "ReadMe File");
INSERT INTO "Documents" VALUES ("9", "107", "Product Launch Slides");
INSERT INTO "Documents" VALUES ("10", "108", "Contract Agreement");
INSERT INTO "Documents" VALUES ("11", "109", "User Manual");
INSERT INTO "Documents" VALUES ("12", "110", "Training Module 1");
INSERT INTO "Documents" VALUES ("13", "102", "Quarterly Review");
INSERT INTO "Documents" VALUES ("14", "105", "Client Pitch");
INSERT INTO "Documents" VALUES ("15", "107", "Conference Presentation");
INSERT INTO "Paragraphs" VALUES ("1", "This is the first paragraph of document 1.");
INSERT INTO "Paragraphs" VALUES ("2", "This is the second paragraph of document 1.");
INSERT INTO "Paragraphs" VALUES ("3", "Introduction slide for the presentation.");
INSERT INTO "Paragraphs" VALUES ("4", "Key financial figures for the report.");
INSERT INTO "Paragraphs" VALUES ("5", "Project objectives and scope.");
INSERT INTO "Paragraphs" VALUES ("6", "Market analysis and target audience.");
INSERT INTO "Paragraphs" VALUES ("7", "Company policies and procedures.");
INSERT INTO "Paragraphs" VALUES ("8", "Executive summary of the briefing.");
INSERT INTO "Paragraphs" VALUES ("9", "Important notes for developers.");
INSERT INTO "Paragraphs" VALUES ("10", "Features and benefits of the new product.");
INSERT INTO "Paragraphs" VALUES ("11", "Terms and conditions of the agreement.");
INSERT INTO "Paragraphs" VALUES ("12", "Step-by-step instructions for users.");
INSERT INTO "Paragraphs" VALUES ("13", "Module objectives and learning outcomes.");
INSERT INTO "Paragraphs" VALUES ("14", "Performance review for Q1.");
INSERT INTO "Paragraphs" VALUES ("15", "Proposed solutions for the client.");