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,
"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),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY ("Document_ID") REFERENCES "Documents"("Document_ID")
);

CREATE TABLE "Templates" (
"Template_ID" INT UNIQUE,
"Template_Details" VARCHAR(255),
PRIMARY KEY ("Template_ID")
);





INSERT INTO "Documents" VALUES ("1", "Customer reviews", "Collection of customer feedback");
INSERT INTO "Documents" VALUES ("2", "Product specifications", "Detailed product information");
INSERT INTO "Documents" VALUES ("3", "Marketing brochure", "Promotional material for new products");
INSERT INTO "Documents" VALUES ("4", "Employee handbook", "Company policies and procedures");
INSERT INTO "Documents" VALUES ("5", "Financial report", "Quarterly financial statements");
INSERT INTO "Documents" VALUES ("6", "Customer reviews old", "Archived customer feedback");
INSERT INTO "Paragraphs" VALUES ("101", "1", "The product exceeded my expectations.");
INSERT INTO "Paragraphs" VALUES ("102", "1", "Great customer service and fast delivery.");
INSERT INTO "Paragraphs" VALUES ("103", "2", "Processor: Intel i7, RAM: 16GB.");
INSERT INTO "Paragraphs" VALUES ("104", "1", "Highly recommend this company.");
INSERT INTO "Paragraphs" VALUES ("105", "3", "Discover our innovative new line.");
INSERT INTO "Paragraphs" VALUES ("106", "1", "A few minor issues, but overall satisfied.");
INSERT INTO "Paragraphs" VALUES ("107", "4", "All employees must adhere to the code of conduct.");
INSERT INTO "Paragraphs" VALUES ("108", "1", "Very disappointed with the quality.");
INSERT INTO "Paragraphs" VALUES ("109", "5", "Revenue increased by 15% this quarter.");
INSERT INTO "Paragraphs" VALUES ("110", "6", "Old review: Satisfied with purchase.");
INSERT INTO "Templates" VALUES ("1001", "Standard review template");
INSERT INTO "Templates" VALUES ("1002", "Technical specification template");
INSERT INTO "Templates" VALUES ("1003", "Marketing campaign template");
INSERT INTO "Templates" VALUES ("1004", "HR document template");
INSERT INTO "Templates" VALUES ("1005", "Financial report template");