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,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
PRIMARY KEY ("Document_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 "Documents" VALUES ("1", "Project Proposal", "Detailed proposal for new project X");
INSERT INTO "Documents" VALUES ("2", "Meeting Minutes", "Minutes from the Q3 planning meeting");
INSERT INTO "Documents" VALUES ("3", "Presentation Slides", "Slides for the annual review presentation");
INSERT INTO "Documents" VALUES ("4", "Financial Report", "Quarterly financial performance report");
INSERT INTO "Documents" VALUES ("5", "Contract Agreement", "Service agreement with Vendor A");
INSERT INTO "Documents" VALUES ("6", "Marketing Brochure", "Brochure for new product launch");
INSERT INTO "Documents" VALUES ("7", "Training Manual", "User manual for software version 2.0");
INSERT INTO "Documents" VALUES ("8", "Research Paper", "Paper on AI in healthcare");
INSERT INTO "Documents" VALUES ("9", "Invoice Template", "Standard invoice format");
INSERT INTO "Documents" VALUES ("10", "Budget Plan", "Annual departmental budget plan");
INSERT INTO "Ref_Template_Types" VALUES ("DOC", "Document");
INSERT INTO "Ref_Template_Types" VALUES ("PPT", "PowerPoint Presentation");
INSERT INTO "Ref_Template_Types" VALUES ("XLS", "Excel Spreadsheet");
INSERT INTO "Ref_Template_Types" VALUES ("PDF", "Portable Document Format");
INSERT INTO "Ref_Template_Types" VALUES ("PP", "Project Proposal");
INSERT INTO "Ref_Template_Types" VALUES ("REP", "Report");
INSERT INTO "Ref_Template_Types" VALUES ("AGR", "Agreement");
INSERT INTO "Ref_Template_Types" VALUES ("MAN", "Manual");
INSERT INTO "Ref_Template_Types" VALUES ("INV", "Invoice");
INSERT INTO "Ref_Template_Types" VALUES ("BUD", "Budget");
INSERT INTO "Templates" VALUES ("101", "DOC");
INSERT INTO "Templates" VALUES ("102", "PPT");
INSERT INTO "Templates" VALUES ("103", "XLS");
INSERT INTO "Templates" VALUES ("104", "PDF");
INSERT INTO "Templates" VALUES ("105", "PP");
INSERT INTO "Templates" VALUES ("106", "PPT");
INSERT INTO "Templates" VALUES ("107", "DOC");
INSERT INTO "Templates" VALUES ("108", "REP");
INSERT INTO "Templates" VALUES ("109", "PP");
INSERT INTO "Templates" VALUES ("110", "XLS");
INSERT INTO "Templates" VALUES ("111", "AGR");
INSERT INTO "Templates" VALUES ("112", "MAN");
INSERT INTO "Templates" VALUES ("113", "INV");
INSERT INTO "Templates" VALUES ("114", "BUD");
INSERT INTO "Templates" VALUES ("115", "PPT");
INSERT INTO "Templates" VALUES ("116", "DOC");
INSERT INTO "Templates" VALUES ("117", "PP");