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", "Welcome to NY", "A document introducing New York City.");
INSERT INTO "Documents" VALUES ("2", "Travel Guide", "A guide for travelers.");
INSERT INTO "Documents" VALUES ("3", "Meeting Minutes", "Minutes from the last meeting.");
INSERT INTO "Documents" VALUES ("4", "Project Proposal", "Proposal for a new project.");
INSERT INTO "Documents" VALUES ("5", "Welcome to LA", "A document introducing Los Angeles.");
INSERT INTO "Paragraphs" VALUES ("101", "1", "New York City, often called NYC, is the most populous city in the United States.");
INSERT INTO "Paragraphs" VALUES ("102", "1", "It is a global hub of finance, culture, and media.");
INSERT INTO "Paragraphs" VALUES ("103", "1", "The city is home to iconic landmarks like the Statue of Liberty and Times Square.");
INSERT INTO "Paragraphs" VALUES ("104", "2", "Before you travel, ensure you have all necessary documents.");
INSERT INTO "Paragraphs" VALUES ("105", "2", "Pack light and be prepared for various weather conditions.");
INSERT INTO "Paragraphs" VALUES ("106", "3", "The meeting started at 10:00 AM.");
INSERT INTO "Paragraphs" VALUES ("107", "3", "Key decisions were made regarding the budget.");
INSERT INTO "Paragraphs" VALUES ("108", "4", "This proposal outlines the scope of the new project.");
INSERT INTO "Paragraphs" VALUES ("109", "1", "Enjoy your stay in the Big Apple!");
INSERT INTO "Paragraphs" VALUES ("110", "5", "Los Angeles is a sprawling Southern California city.");
INSERT INTO "Templates" VALUES ("1001", "Standard Document Template");
INSERT INTO "Templates" VALUES ("1002", "Travel Guide Template");
INSERT INTO "Templates" VALUES ("1003", "Meeting Minutes Template");