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),
PRIMARY KEY ("Document_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")
);





INSERT INTO "Documents" VALUES ("1", "Meeting Minutes 2023-10-26");
INSERT INTO "Documents" VALUES ("2", "Project Proposal Alpha");
INSERT INTO "Documents" VALUES ("3", "Company Policy Handbook");
INSERT INTO "Documents" VALUES ("4", "Research Paper on AI");
INSERT INTO "Documents" VALUES ("5", "Client Contract Draft");
INSERT INTO "Paragraphs" VALUES ("101", "1", "Attendees: John Doe, Jane Smith, Bob Johnson.");
INSERT INTO "Paragraphs" VALUES ("102", "1", "Discussion: Q4 budget review and upcoming project timelines.");
INSERT INTO "Paragraphs" VALUES ("103", "1", "Action Items: John to follow up on budget discrepancies.");
INSERT INTO "Paragraphs" VALUES ("104", "1", "Next Meeting: November 9th, 2023.");
INSERT INTO "Paragraphs" VALUES ("201", "2", "Introduction to Project Alpha, aiming to revolutionize data analytics.");
INSERT INTO "Paragraphs" VALUES ("202", "2", "Key Objectives: Improve efficiency by 30%, reduce operational costs.");
INSERT INTO "Paragraphs" VALUES ("203", "2", "Methodology: Agile development with bi-weekly sprints.");
INSERT INTO "Paragraphs" VALUES ("301", "3", "Section 1: Employee Conduct and Ethics.");
INSERT INTO "Paragraphs" VALUES ("302", "3", "Section 2: Data Privacy and Security Guidelines.");
INSERT INTO "Paragraphs" VALUES ("303", "3", "Section 3: Leave and Absence Policy.");
INSERT INTO "Paragraphs" VALUES ("304", "3", "Section 4: Health and Safety Regulations.");
INSERT INTO "Paragraphs" VALUES ("401", "4", "Abstract: This paper explores the latest advancements in artificial intelligence.");
INSERT INTO "Paragraphs" VALUES ("402", "4", "Methodology: Comparative analysis of deep learning algorithms.");
INSERT INTO "Paragraphs" VALUES ("403", "4", "Results: Significant improvements in natural language processing tasks.");
INSERT INTO "Paragraphs" VALUES ("501", "5", "Agreement between Company X and Client Y for software development services.");
INSERT INTO "Paragraphs" VALUES ("502", "5", "Scope of Work: Development of a custom CRM system.");
INSERT INTO "Paragraphs" VALUES ("503", "5", "Payment Terms: 50% upfront, 50% upon project completion.");