The document creates a database called Resturant_Booking_System and then defines several tables to store customer, booking, table, menu, order, ingredients, staff, and billing data for a restaurant management system. Primary and foreign keys are specified to link records between the different tables.
The document creates a database called Resturant_Booking_System and then defines several tables to store customer, booking, table, menu, order, ingredients, staff, and billing data for a restaurant management system. Primary and foreign keys are specified to link records between the different tables.
The document creates a database called Resturant_Booking_System and then defines several tables to store customer, booking, table, menu, order, ingredients, staff, and billing data for a restaurant management system. Primary and foreign keys are specified to link records between the different tables.
CUST_ID INT PRIMARY KEY AUTO_INCREMENT, FIRST_NAME VARCHAR(30) NOT NULL, LAST_NAME VARCHAR(30) NOT NULL, PHONE_NO BIGINT );
CREATE TABLE Booking(
BOOK_ID INT PRIMARY KEY, BOOK_TIME DATE, REF_CUST_ID INT, FOREIGN KEY (REF_CUST_ID) REFERENCES Customer(CUST_ID) ON DELETE CASCADE );
CREATE TABLE `TABLE`(
TABLE_NO INT PRIMARY KEY AUTO_INCREMENT, CAPACITY INT NOT NULL, REF_BOOK_ID INT, FOREIGN KEY (REF_BOOK_ID) REFERENCES Booking(BOOK_ID) );
CREATE TABLE Menu(
Serial_no INT PRIMARY KEY AUTO_INCREMENT, Dish_name VARCHAR(30) NOT NULL, Price DECIMAL(8,2) NOT NULL );
CREATE TABLE `ORDER`(
REF_SERIAL_NO INT NOT NULL, REF_TABLE_NO INT NOT NULL, FOREIGN KEY (REF_SERIAL_NO) REFERENCES MENU(SERIAL_NO) ON DELETE CASCADE, FOREIGN KEY (REF_TABLE_NO) REFERENCES `TABLE`(TABLE_NO) ON DELETE CASCADE );
CREATE TABLE Ingredients (
ING_NO INT PRIMARY KEY AUTO_INCREMENT, ING_NAME VARCHAR(50) NOT NULL, ING_PRICE DECIMAL(8,2) NOT NULL );
CREATE TABLE Staff (
STAFF_NO INT PRIMARY KEY AUTO_INCREMENT, STAFF_NAME VARCHAR(30) NOT NULL, STAFF_SAL DECIMAL(8,2) DEFAULT NULL );