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 Legal Template");
INSERT INTO "Templates" VALUES ("2", "Marketing Brochure Template");
INSERT INTO "Templates" VALUES ("3", "Technical Report Template");
INSERT INTO "Templates" VALUES ("4", "Financial Statement Template");
INSERT INTO "Templates" VALUES ("5", "HR Policy Template");
INSERT INTO "Documents" VALUES ("101", "1", "Contract Agreement v1.0");
INSERT INTO "Documents" VALUES ("102", "2", "Product Launch Brochure");
INSERT INTO "Documents" VALUES ("103", "1", "Service Level Agreement");
INSERT INTO "Documents" VALUES ("104", "3", "Annual Technical Review");
INSERT INTO "Documents" VALUES ("105", "4", "Q3 Financial Report");
INSERT INTO "Documents" VALUES ("106", "1", "Partnership Deed");
INSERT INTO "Documents" VALUES ("107", "2", "Company Profile");
INSERT INTO "Documents" VALUES ("108", "3", "Research Paper on AI");
INSERT INTO "Documents" VALUES ("109", "5", "Employee Handbook");
INSERT INTO "Documents" VALUES ("110", "1", "Non-Disclosure Agreement");
INSERT INTO "Paragraphs" VALUES ("1", "101", "This is the first paragraph of the contract.");
INSERT INTO "Paragraphs" VALUES ("2", "101", "The parties agree to the terms and conditions herein.");
INSERT INTO "Paragraphs" VALUES ("3", "101", "Further details are provided in Appendix A.");
INSERT INTO "Paragraphs" VALUES ("4", "101", "Signatures are required below.");
INSERT INTO "Paragraphs" VALUES ("5", "101", "This contract is legally binding.");
INSERT INTO "Paragraphs" VALUES ("6", "101", "All rights reserved.");
INSERT INTO "Paragraphs" VALUES ("7", "102", "Welcome to our new product!");
INSERT INTO "Paragraphs" VALUES ("8", "102", "Discover amazing features.");
INSERT INTO "Paragraphs" VALUES ("9", "102", "Limited time offer.");
INSERT INTO "Paragraphs" VALUES ("10", "103", "This SLA outlines service expectations.");
INSERT INTO "Paragraphs" VALUES ("11", "103", "Response times are guaranteed.");
INSERT INTO "Paragraphs" VALUES ("12", "103", "Uptime commitment is 99.9%.");
INSERT INTO "Paragraphs" VALUES ("13", "103", "Penalties apply for non-compliance.");
INSERT INTO "Paragraphs" VALUES ("14", "104", "Introduction to the annual review.");
INSERT INTO "Paragraphs" VALUES ("15", "104", "Key findings and recommendations.");
INSERT INTO "Paragraphs" VALUES ("16", "104", "Future outlook and next steps.");
INSERT INTO "Paragraphs" VALUES ("17", "104", "Data analysis results.");
INSERT INTO "Paragraphs" VALUES ("18", "104", "Conclusion of the report.");
INSERT INTO "Paragraphs" VALUES ("19", "105", "Financial summary for Q3.");
INSERT INTO "Paragraphs" VALUES ("20", "105", "Revenue breakdown by segment.");
INSERT INTO "Paragraphs" VALUES ("21", "105", "Expense analysis.");
INSERT INTO "Paragraphs" VALUES ("22", "106", "This partnership deed establishes a joint venture.");
INSERT INTO "Paragraphs" VALUES ("23", "106", "Roles and responsibilities are defined.");
INSERT INTO "Paragraphs" VALUES ("24", "106", "Profit sharing agreement.");
INSERT INTO "Paragraphs" VALUES ("25", "106", "Dispute resolution clause.");
INSERT INTO "Paragraphs" VALUES ("26", "106", "Term of the partnership.");
INSERT INTO "Paragraphs" VALUES ("27", "106", "Governing law.");
INSERT INTO "Paragraphs" VALUES ("28", "106", "Termination conditions.");
INSERT INTO "Paragraphs" VALUES ("29", "107", "About our company.");
INSERT INTO "Paragraphs" VALUES ("30", "107", "Our mission and vision.");
INSERT INTO "Paragraphs" VALUES ("31", "108", "Abstract of the research paper.");
INSERT INTO "Paragraphs" VALUES ("32", "108", "Methodology used in the study.");
INSERT INTO "Paragraphs" VALUES ("33", "108", "Experimental results.");
INSERT INTO "Paragraphs" VALUES ("34", "108", "Discussion of findings.");
INSERT INTO "Paragraphs" VALUES ("35", "108", "Future work and limitations.");
INSERT INTO "Paragraphs" VALUES ("36", "109", "Welcome to our team!");
INSERT INTO "Paragraphs" VALUES ("37", "109", "Company policies.");
INSERT INTO "Paragraphs" VALUES ("38", "109", "Employee benefits.");
INSERT INTO "Paragraphs" VALUES ("39", "109", "Code of conduct.");
INSERT INTO "Paragraphs" VALUES ("40", "110", "This NDA protects confidential information.");
INSERT INTO "Paragraphs" VALUES ("41", "110", "Definition of confidential information.");
INSERT INTO "Paragraphs" VALUES ("42", "110", "Obligations of the receiving party.");
INSERT INTO "Paragraphs" VALUES ("43", "110", "Term of confidentiality.");
INSERT INTO "Paragraphs" VALUES ("44", "110", "Remedies for breach.");