We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Food Order App
Table Design
CREATE TABLE menucategory (
category_id INT AUTO_INCREMENT PRIMARY KEY, menu_item_category VARCHAR(50) NOT NULL, created_date DATETIME, updated_date DATETIME );
CREATE TABLE menuitem (
menu_item_id INT AUTO_INCREMENT PRIMARY KEY, menu_item_name VARCHAR(100) NOT NULL, menu_item_description TEXT, menu_item_price DECIMAL(10, 2) NOT NULL, menu_item_category_id INT NOT NULL, FOREIGN KEY (menu_item_category_id) REFERENCES menu_category(category_id), created_date DATETIME, updated_date DATETIME );
CREATE TABLE order (
order_id INT AUTO_INCREMENT PRIMARY KEY, order_date DATETIME NOT NULL, total_amount DECIMAL(10, 2) NOT NULL, created_date DATETIME, updated_date DATETIME );
CREATE TABLE delivery (
delivery_id INT AUTO_INCREMENT PRIMARY KEY, is_deliver BOOLEAN NOT NULL, -- Boolean to indicate if it's a delivery (true) or not (false) delivery_charge DECIMAL(10, 2) NOT NULL, -- Fixed delivery charge order_id INT NOT NULL,-- Reference to the Order table created_date DATETIME, updated_date DATETIME FOREIGN KEY (order_id) REFERENCES Order(order_id) );
CREATE TABLE orderitem (
order_item_id INT AUTO_INCREMENT PRIMARY KEY, order_id INT NOT NULL, item_id INT NOT NULL, quantity INT NOT NULL, created_date DATETIME, updated_date DATETIME FOREIGN KEY (order_id) REFERENCES order(order_id), FOREIGN KEY (item_id) REFERENCES Items(item_id) );
CREATE TABLE payment (
payment_id INT AUTO_INCREMENT PRIMARY KEY, order_id INT NOT NULL, payment_amount DECIMAL(10, 2) NOT NULL, payment_date DATETIME NOT NULL, created_date DATETIME, updated_date DATETIME FOREIGN KEY (Order_ID) REFERENCES Order(order_id) );