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,
"Template_ID" INT,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
PRIMARY KEY ("Document_ID")
);

CREATE TABLE "Paragraphs" (
"Paragraph_ID" INT,
"Document_ID" INT,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY ("Document_ID") REFERENCES "Documents"("Document_ID")
);





INSERT INTO "Documents" VALUES ("1", "101", "Report_A", "Annual Sales Report");
INSERT INTO "Documents" VALUES ("2", "102", "Memo_B", "Internal Communication");
INSERT INTO "Documents" VALUES ("3", "103", "Contract_C", "Client Agreement");
INSERT INTO "Documents" VALUES ("4", "101", "Report_D", "Quarterly Financials");
INSERT INTO "Documents" VALUES ("5", "104", "Policy_E", "Company Policy Handbook");
INSERT INTO "Documents" VALUES ("6", "105", "Presentation_F", "Marketing Strategy");
INSERT INTO "Paragraphs" VALUES ("1", "1", "This is the first paragraph of Report_A.", "Details for paragraph 1");
INSERT INTO "Paragraphs" VALUES ("2", "1", "Sales figures for Q1 were strong.", "Financial data");
INSERT INTO "Paragraphs" VALUES ("3", "2", "Meeting minutes from last week.", "Action items");
INSERT INTO "Paragraphs" VALUES ("4", "3", "Terms and conditions of the agreement.", "Legal clauses");
INSERT INTO "Paragraphs" VALUES ("5", "4", "Summary of Q2 performance.", "Performance metrics");
INSERT INTO "Paragraphs" VALUES ("6", "5", "Company policy on remote work.", "HR guidelines");
INSERT INTO "Paragraphs" VALUES ("7", "6", "Introduction to the new marketing campaign.", "Campaign overview");
INSERT INTO "Paragraphs" VALUES ("8", "1", "The market in Korea showed significant growth.", "Geographical analysis");
INSERT INTO "Paragraphs" VALUES ("9", "2", "Please review the attached document.", "Review request");
INSERT INTO "Paragraphs" VALUES ("10", "3", "Payment schedule is outlined below.", "Payment terms");
INSERT INTO "Paragraphs" VALUES ("11", "4", "Future projections for Korea are positive.", "Future outlook");
INSERT INTO "Paragraphs" VALUES ("12", "5", "All employees must adhere to this policy.", "Compliance note");
INSERT INTO "Paragraphs" VALUES ("13", "6", "Our target audience in Korea is young professionals.", "Target audience");
INSERT INTO "Paragraphs" VALUES ("14", "1", "This paragraph does not mention Korea.", "General information");
INSERT INTO "Paragraphs" VALUES ("15", "2", "Another paragraph without Korea.", "Miscellaneous");
INSERT INTO "Paragraphs" VALUES ("16", "3", "Korea is a key market for us.", "Market focus");