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 "Professionals" (
"professional_id" INT UNIQUE,
"first_name" VARCHAR(50),
"last_name" VARCHAR(50),
PRIMARY KEY ("professional_id")
);

CREATE TABLE "Treatment_Types" (
"treatment_type_code" VARCHAR(10),
"treatment_type_description" VARCHAR(80),
PRIMARY KEY ("treatment_type_code")
);

CREATE TABLE "Treatments" (
"treatment_id" INT,
"professional_id" INT,
"treatment_type_code" VARCHAR(10),
"date_of_treatment" DATETIME,
"cost_of_treatment" DECIMAL(19, 4),
PRIMARY KEY ("treatment_id"),
FOREIGN KEY ("professional_id") REFERENCES "Professionals"("professional_id"),
FOREIGN KEY ("treatment_type_code") REFERENCES "Treatment_Types"("treatment_type_code")
);





INSERT INTO "Professionals" VALUES ("1", "Alice", "Smith");
INSERT INTO "Professionals" VALUES ("2", "Bob", "Johnson");
INSERT INTO "Professionals" VALUES ("3", "Carol", "Williams");
INSERT INTO "Professionals" VALUES ("4", "David", "Brown");
INSERT INTO "Professionals" VALUES ("5", "Eve", "Jones");
INSERT INTO "Treatment_Types" VALUES ("TT01", "Vaccination");
INSERT INTO "Treatment_Types" VALUES ("TT02", "Deworming");
INSERT INTO "Treatment_Types" VALUES ("TT03", "Grooming");
INSERT INTO "Treatment_Types" VALUES ("TT04", "Surgery");
INSERT INTO "Treatment_Types" VALUES ("TT05", "Dental Cleaning");
INSERT INTO "Treatments" VALUES ("101", "1", "TT01", "2024-01-10 09:00:00", "50.00");
INSERT INTO "Treatments" VALUES ("102", "2", "TT02", "2024-01-11 10:30:00", "30.00");
INSERT INTO "Treatments" VALUES ("103", "3", "TT03", "2024-01-12 11:00:00", "40.00");
INSERT INTO "Treatments" VALUES ("104", "4", "TT04", "2024-01-13 14:00:00", "200.00");
INSERT INTO "Treatments" VALUES ("105", "5", "TT05", "2024-01-14 15:30:00", "150.00");
INSERT INTO "Treatments" VALUES ("106", "1", "TT02", "2024-01-15 09:00:00", "25.00");
INSERT INTO "Treatments" VALUES ("107", "2", "TT03", "2024-01-16 10:30:00", "45.00");
INSERT INTO "Treatments" VALUES ("108", "3", "TT01", "2024-01-17 11:00:00", "55.00");
INSERT INTO "Treatments" VALUES ("109", "4", "TT05", "2024-01-18 14:00:00", "160.00");
INSERT INTO "Treatments" VALUES ("110", "5", "TT04", "2024-01-19 15:30:00", "210.00");
INSERT INTO "Treatments" VALUES ("111", "1", "TT03", "2024-01-20 09:00:00", "35.00");
INSERT INTO "Treatments" VALUES ("112", "2", "TT01", "2024-01-21 10:30:00", "60.00");
INSERT INTO "Treatments" VALUES ("113", "3", "TT04", "2024-01-22 11:00:00", "190.00");
INSERT INTO "Treatments" VALUES ("114", "4", "TT02", "2024-01-23 14:00:00", "28.00");
INSERT INTO "Treatments" VALUES ("115", "5", "TT03", "2024-01-24 15:30:00", "38.00");