Initial commit

This commit is contained in:
user
2026-07-12 13:47:34 +04:00
commit 51e2e789d0
37 changed files with 2005 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
CREATE TABLE IF NOT EXISTS Tables (
-- column-def:
id INTEGER -- column-constraint:
CONSTRAINT PK_Tables PRIMARY KEY AUTOINCREMENT,
--
name INTEGER NOT NULL UNIQUE,
--
max_people INTEGER NOT NULL,
--
room TEXT NOT NULL,
-- table-constraint:
CONSTRAINT CHK_max_people CHECK (
max_people > 0
AND max_people < 11
)
);
CREATE TABLE IF NOT EXISTS Bookings (
-- column-def:
id INTEGER -- column-constraint:
CONSTRAINT PK_Bookings PRIMARY KEY AUTOINCREMENT,
--
id_tables INTEGER,
--
reservation TEXT NOT NULL,
--
time_reserve TEXT NOT NULL,
--
who_booked TEXT NOT NULL,
-- table-constraint:
CONSTRAINT FK_Bookings_Tables FOREIGN KEY (id_tables) REFERENCES Tables (id),
CONSTRAINT CHK_min_max_time_reserve CHECK (time_reserve BETWEEN "00:30" AND "12:00")
);