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),
"Other_Details" 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")
);

CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15),
"Template_Type_Description" VARCHAR(255),
PRIMARY KEY ("Template_Type_Code")
);

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





INSERT INTO "Documents" VALUES ("1", "Travel Guide", "A comprehensive guide to Asian countries", "Includes maps and tips");
INSERT INTO "Documents" VALUES ("2", "Business Report", "Annual financial report", "Confidential");
INSERT INTO "Documents" VALUES ("3", "Cultural Overview", "Overview of East Asian cultures", "Focus on traditions and festivals");
INSERT INTO "Documents" VALUES ("4", "Technology Trends", "Latest trends in AI and robotics", "Includes case studies");
INSERT INTO "Documents" VALUES ("5", "Health and Wellness", "Guide to healthy living", "Nutrition and exercise tips");
INSERT INTO "Paragraphs" VALUES ("101", "1", "South Korea is known for its vibrant culture and technology.", "Paragraph about Korea");
INSERT INTO "Paragraphs" VALUES ("102", "1", "Japan offers a unique blend of tradition and modernity.", "Paragraph about Japan");
INSERT INTO "Paragraphs" VALUES ("103", "2", "The financial year showed a 10% increase in revenue.", "Summary paragraph");
INSERT INTO "Paragraphs" VALUES ("104", "3", "Korea has a rich history of festivals and traditional music.", "Cultural details");
INSERT INTO "Paragraphs" VALUES ("105", "3", "China's influence on East Asia is significant.", "Cultural influence");
INSERT INTO "Paragraphs" VALUES ("106", "4", "AI is transforming industries worldwide.", "Tech overview");
INSERT INTO "Paragraphs" VALUES ("107", "5", "Regular exercise improves mental health.", "Health advice");
INSERT INTO "Paragraphs" VALUES ("108", "1", "Travel tips for Korea include visiting Seoul and Busan.", "Travel advice");
INSERT INTO "Paragraphs" VALUES ("109", "3", "Korean cuisine is famous for its spicy flavors.", "Food culture");
INSERT INTO "Ref_Template_Types" VALUES ("TPL001", "Travel Document");
INSERT INTO "Ref_Template_Types" VALUES ("TPL002", "Business Document");
INSERT INTO "Ref_Template_Types" VALUES ("TPL003", "Cultural Document");
INSERT INTO "Ref_Template_Types" VALUES ("TPL004", "Technology Document");
INSERT INTO "Ref_Template_Types" VALUES ("TPL005", "Health Document");
INSERT INTO "Templates" VALUES ("201", "Template for travel guides with sections on culture and tips");
INSERT INTO "Templates" VALUES ("202", "Template for business reports with financial summaries");
INSERT INTO "Templates" VALUES ("203", "Template for cultural overviews with historical context");
INSERT INTO "Templates" VALUES ("204", "Template for technology trend reports with case studies");
INSERT INTO "Templates" VALUES ("205", "Template for health and wellness guides with nutrition advice");