-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
40 lines (36 loc) · 1.62 KB
/
database.sql
File metadata and controls
40 lines (36 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
CREATE DATABASE IF NOT EXISTS onlinefoodorderingsystem;
USE onlinefoodorderingsystem;
CREATE TABLE IF NOT EXISTS Menu (
ItemID INT AUTO_INCREMENT PRIMARY KEY,
ItemName VARCHAR(100),
Category VARCHAR(50),
Price DECIMAL(10,2),
Description TEXT
);
CREATE TABLE IF NOT EXISTS Orders (
OrderID INT AUTO_INCREMENT PRIMARY KEY,
CustomerName VARCHAR(100),
ItemID INT,
Quantity INT,
TotalCost DECIMAL(10,2),
OrderTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (ItemID) REFERENCES Menu(ItemID)
);
CREATE TABLE IF NOT EXISTS BillSummary (
BillID INT AUTO_INCREMENT PRIMARY KEY,
CustomerName VARCHAR(100),
TotalAmount DECIMAL(10,2),
GeneratedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO Menu (ItemName, Category, Price, Description) VALUES
('Butter Chicken', 'Indian', 350.00, 'Creamy chicken curry with spices.'),
('Paneer Butter Masala', 'Indian', 280.00, 'Paneer cubes in a rich tomato gravy.'),
('Masala Dosa', 'Indian', 150.00, 'Crispy rice crepe with potato filling.'),
('Biryani (Chicken)', 'Indian', 300.00, 'Aromatic spiced rice with chicken.'),
('Margherita Pizza', 'Italian', 400.00, 'Classic cheese pizza with basil.'),
('Alfredo Pasta', 'Italian', 350.00, 'Creamy white sauce pasta.'),
('Tiramisu', 'Italian', 250.00, 'Coffee-flavored Italian dessert.'),
('Sushi Platter', 'Japanese', 500.00, 'Assorted sushi with wasabi and soy.'),
('Caesar Salad', 'Continental', 200.00, 'Crisp lettuce with Caesar dressing.'),
('BBQ Chicken Wings', 'American', 350.00, 'Spicy grilled chicken wings.'),
('Chowmin', 'Chinese', 50.00, 'Stir-fried noodles with vegetables and sauces.');