0% found this document useful (0 votes)
546 views27 pages

DBMS PBL

Uploaded by

akashramagiri42
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
546 views27 pages

DBMS PBL

Uploaded by

akashramagiri42
Copyright
© © All Rights Reserved
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

DATABASE MANAGEMENT SYSTEM

PROJECT BASED
LEARNING on
TASTY TRACK : FOOD ORDERING SYSTEM

Submitted in partial fulfilment of the


Requirements for the award of the degree of
BACHELOR OF TECHNOLOGY
in Computer Science and Engineering
(AIML)
Submitted by

M.SANJAY - 23R11A6628
P.UDAY KIRAN - 23R11A6637
R.LOKESH REDDY - 23R11A6638

Under the esteemed guidance of


Dr.K.Arpitha
Geethanjali College of Engineering and Technology

Geethanjali College of Engineering and Technology


Department of Computer Science and Engineering (AIML)
(UGC AUTONOMOUS INSTITUTION)

Accredited by NAAC with ‘A+’ Grade & NBA, Approved by AICTE and Affiliated to

JNTUH Cheeryal (V), Keesara (M), Medchal (Dist), Telangana – 501 301.
CERTIFICATE

This is to certify that the Data Base Management System Project Based Learning (PBL) Report entitled
"Tasty Track : Food Ordering System" is a bonafide work done and submitted by M.SANJAY
(23R11A6628) ,P.UDAY KIRAN(23R11A6637) , R.LOKESH REDDY(23R11A6638), during the
academic year 2024 - 2025, in partial fulfilment of requirement for the award of Bachelor of Technology
Degree in "Computer Science and Engineering(AI&ML)" from Geethanjali College of Engineering and
Technology (Accredited by NAAC with "A+" Grade & NBA, Approved by AICTE and Affiliated to
JNTUH), is a bonafide record of work carried out by them under guidance and supervision.

It is certified further that to my best of the knowledge, the work in this project has not been submitted to
any other institution for the award of any degree or diploma.

FACULTY GUIDE HEAD OF DEPARTMENT


Dr.K.Arpitha Dr.G.Bindhu Madhavi
Asso.Professor
CSE(AI&ML)Department CSE(AI&ML)Department
DECLARATION

We hereby declare that the project report entitled “TASTY TRACK : FOOD ORDERING SYSTEM”
is an original work done and submitted to CSE(AI&ML) Department, from Geethanjali College of
Engineering and Technology, affiliated to JNTUH, accredited by NAAC with A+ Grade & NBA,
approved by AICTE in partial fulfilment of the requirement for the award of Bachelor of Technology
in Computer Science and Engineering (A&ML), and it is a record of bonafide project work carried out
by us under the guidance of Dr.K.Arpitha, Assistant Professor, Department of CSE(AI&ML).

We further declare that the work reported in this project has not been submitted, either in part or in
full, for the award of any other degree or diploma in this institute or any other Institute or University.

SIGNATURE OF THE STUDENT


M.SANJAY - 23R11A6628
P.UDAY KIRAN - 23R11A6637
R.LOKESH REDDY -23R11A6632
TABLE OF CONTENTS
S.No Contents Page No

1. Abstract 1

2. Introduction 2

3. System Design 3

4. Implementation 5

5. Conclusion 20

6. References 21
ABSTRACT

The Food Ordering System is a database-driven solution designed to streamline the management of food
orders for restaurants and food delivery services. Using SQL, the system efficiently organizes data related to
customers, menu items, orders, and order details. The project incorporates features like menu management,
order tracking, and customer data management while ensuring data consistency through relational database
principles. Utilizing SQL, the system efficiently organizes and manages data related to customers, menu
items, orders, and order details. The project focuses on creating a relational database to ensure data integrity,
reduce redundancy. The Food Ordering System demonstrates the effective use of SQL for real-world
application development, ensuring both operational efficiency and user satisfaction.

Key features include the ability for customers to browse menus, place orders, and track delivery status,
while administrators can manage menus, update order statuses, and generate sales reports. The system
leverages SQL queries to perform CRUD operations, optimize data retrieval, and ensure smooth
performance even with large datasets.

With its scalable architecture and potential for integration with frontend interfaces and advanced analytics
tools, the Food Ordering System serves as a foundational solution for modernizing food service operations.
It showcases the practical application of SQL in solving real-world challenges, making the process efficient,
reliable, and user-friendly.

1
INTRODUCTION

In the fast-paced digital world, food ordering systems have transformed how restaurants operate
and customers interact with them. The Food Ordering System is a database-centric application
designed to manage and streamline the process of ordering, tracking, and managing food orders
effectively. This project uses SQL as the core technology to implement a structured, relational
database that ensures data integrity, scalability, and high performance.

Restaurants often face challenges such as managing large volumes of customer orders, ensuring
accurate delivery, and maintaining a comprehensive menu. A well-designed food ordering
system addresses these challenges by automating repetitive tasks and providing real-time access
to crucial data like menu availability, order status, and customer preferences.

This project provides a robust backend system capable of handling various operational
requirements for both customers and administrators. Customers can browse the menu, place
orders, and track their order status, while administrators can manage the menu, update order
statuses, and analyse sales data.

The system also incorporates principles of database normalization to eliminate redundancy and
ensure efficient storage and retrieval of information. By using SQL queries, the system supports
essential operations like adding new orders, updating existing ones, and generating detailed
reports on order history and sales performance.

Objectives

1. To automate the food ordering process.

2. To manage restaurant menus and customer orders efficiently.

3. To ensure secure storage and retrieval of data using SQL.

4. To provide real-time data for analytics and reporting.

2
System Design

1. Customer Module:
User registration and login.
Browse menus and place orders.

2. Restaurant Module:
Manage menu items (add, update, delete).
View and manage orders.

3. Order Management Module:


Process customer orders.
Update order status (e.g., pending, in-progress, delivered).

4. Delivery Module:
Assign delivery personnel to orders.
Track delivery status.

Database Design

Entities and Attributes

1. Customers : CustomerID, Name, Email, Phone, Address.

2. Restaurants : RestaurantID, Name, Location, Contact.

3. MenuItems : ItemID, RestaurantID, ItemName, Description, Price.

4. Orders : OrderID, CustomerID, RestaurantID, OrderDate, TotalAmount, Status.

5. OrderDetails :OrderDetailID, OrderID, ItemID, Quantity, SubTotal.

6. DeliveryPersonnel:DeliveryID, Name, Phone, Status.

7. DeliveryAssignments : AssignmentID, OrderID, DeliveryID, AssignedDate, Status.

3
Relationships:

1. One customer can place many orders.

2. One restaurant can have many menu items.

3. One order can have multiple items.

4. One delivery personnel can handle multiple deliveries.

Entity Relationship Diagram

4
IMPLEMENTATION

Database Setup
The implementation is done using MySQL (or any other relational database system). The
following SQL commands were used to create the tables and establish relationships
between them:

Database Creation

CREATE DATABASE

FoodOrderingSystem; USE

FoodOrderingSystem;

Tables Creation

1. Customers Table

CREATE TABLE Customers (

CustomerID INT AUTO_INCREMENT PRIMARY KEY,

Name VARCHAR(100),

Email VARCHAR(100),

Phone VARCHAR(15),

Address TEXT

);

2. Restaurants Table

CREATE TABLE Restaurants (

RestaurantID INT AUTO_INCREMENT PRIMARY KEY,

Name VARCHAR(100),

Location VARCHAR(100),

Contact VARCHAR(15)

5
);

6
3. MenuItems Table

CREATE TABLE MenuItems (

ItemID INT AUTO_INCREMENT PRIMARY KEY,

RestaurantID INT,

ItemName

VARCHAR(100),

Description TEXT,

Price DECIMAL(10,

2),

FOREIGN KEY (RestaurantID) REFERENCES Restaurants(RestaurantID)

);

4. Orders Table

CREATE TABLE Orders (

OrderID INT AUTO_INCREMENT PRIMARY KEY,

CustomerID INT,

RestaurantID INT,

OrderDate DATETIME,

TotalAmount DECIMAL(10, 2),

Status ENUM('Pending', 'In-Progress', 'Delivered'),

FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID),

FOREIGN KEY (RestaurantID) REFERENCES Restaurants(RestaurantID)

);

7
5. OrderDetails Table

CREATE TABLE OrderDetails (

OrderDetailID INT AUTO_INCREMENT PRIMARY KEY,

OrderID INT,

ItemID INT,

Quantity INT,

SubTotal DECIMAL(10, 2),

FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),

FOREIGN KEY (ItemID) REFERENCES MenuItems(ItemID)

);

6. DeliveryPersonnel Table

CREATE TABLE DeliveryPersonnel (

DeliveryID INT AUTO_INCREMENT PRIMARY KEY,

Name VARCHAR(100),

Phone VARCHAR(15),

Status ENUM('Available', 'Busy')

);

7. DeliveryAssignments Table

CREATE TABLE DeliveryAssignments (

AssignmentID INT AUTO_INCREMENT PRIMARY KEY,

OrderID INT,

DeliveryID INT,

AssignedDate DATETIME,

Status ENUM('Pending', 'In-Transit', 'Delivered'),

8
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),

FOREIGN KEY (DeliveryID) REFERENCES DeliveryPersonnel(DeliveryID)

);

Data Insertion
After setting up the database schema, sample data is inserted into the tables.

1. Customers Table
INSERT INTO Customers (Name, Email, Phone, Address) VALUES
('John Doe', 'john.doe@example.com', '9876543210', '123 Elm Street'),
('Jane Smith', 'jane.smith@example.com', '8765432109', '456 Maple Avenue'),
('Robert Brown', 'robert.brown@example.com', '7654321098', '789 Oak Drive'),
('Emily Davis', 'emily.davis@example.com', '6543210987', '101 Pine Lane'),
('Michael Wilson', 'michael.wilson@example.com', '5432109876', '202 Cedar Road'),
('Sarah Taylor', 'sarah.taylor@example.com', '4321098765', '303 Birch Street'),
('William Johnson', 'william.johnson@example.com', '3210987654', '404 Cherry
Way'), ('Olivia Lee', 'olivia.lee@example.com', '2109876543', '505 Walnut
Boulevard'), ('James Anderson', 'james.anderson@example.com', '1098765432', '606
Ash Street'),
('Sophia Martinez', 'sophia.martinez@example.com', '0987654321', '707 Spruce Terrace');

2. Restaurants Table

INSERT INTO Restaurants (Name, Location, Contact)


VALUES ('Pizza Palace', '123 Main Street, City A',
'9991112233'), ('Burger Barn', '456 Elm Street, City B',
'8882223344'),
('Pasta Paradise', '789 Oak Drive, City C', '7773334455'),
('Sushi Spot', '101 Pine Lane, City D', '6664445566'),
('Taco Tower', '202 Cedar Road, City E', '5555556677'),
('Grill Garden', '303 Birch Street, City F', '4446667788'),
('Indian Flavors', '404 Cherry Way, City G',
'3337778899'),
('BBQ Bistro', '505 Walnut Boulevard, City H', '2228889900'),
9
('Vegan Delights', '606 Ash Street, City I', '1119990011'),
('Seafood Shack', '707 Spruce Terrace, City J', '0001112233');

1
0
3. MenuItems Table

INSERT INTO MenuItems (RestaurantID, ItemName, Description, Price) VALUES


(1, 'Margherita Pizza', 'Classic cheese and tomato pizza', 8.99),
(1, 'Pepperoni Pizza', 'Pepperoni and mozzarella cheese', 10.99),
(2, 'Cheeseburger', 'Beef patty with cheese, lettuce, and tomato', 6.99),
(2, 'Veggie Burger', 'Grilled veggies with special sauce', 7.49),
(3, 'Spaghetti Carbonara', 'Spaghetti with creamy bacon sauce', 11.99),
(3, 'Fettuccine Alfredo', 'Fettuccine pasta in Alfredo sauce', 12.49),
(4, 'California Roll', 'Crab, avocado, and cucumber sushi roll', 9.99),
(4, 'Tuna Sashimi', 'Slices of fresh tuna', 14.49),
(5, 'Beef Taco', 'Seasoned beef with toppings in a taco shell', 3.99),
(5, 'Chicken Quesadilla', 'Grilled chicken and cheese in a tortilla', 5.99);

4. Orders Table

INSERT INTO Orders (CustomerID, RestaurantID, OrderDate, TotalAmount, Status)


VALUES (1, 1, '2024-11-17 12:00:00', 19.98, 'Pending'),
(2, 2, '2024-11-17 12:30:00', 13.98, 'In-Progress'),
(3, 3, '2024-11-17 13:00:00', 24.48, 'Delivered'),
(4, 4, '2024-11-17 13:30:00', 14.99, 'Pending'),
(5, 5, '2024-11-17 14:00:00', 11.98, 'Delivered'),
(6, 1, '2024-11-17 14:30:00', 19.98, 'Cancelled'),
(7, 2, '2024-11-17 15:00:00', 13.98, 'In-Progress'),
(8, 3, '2024-11-17 15:30:00', 24.48, 'Delivered'),
(9, 4, '2024-11-17 16:00:00', 14.99, 'Pending'),
(10, 5, '2024-11-17 16:30:00', 11.98, 'Cancelled');

5. OrderDetails Table

INSERT INTO OrderDetails (OrderID, ItemID, Quantity, SubTotal) VALUES


(1, 1, 2, 17.98),
(2, 3, 2, 13.98),
(3, 5, 3, 11.97),
(4, 7, 1, 9.99),
1
1
(5, 9, 2, 7.98),
(6, 2, 1, 8.99),
(7, 4, 1, 12.49),
(8, 6, 2, 24.98),
(9, 8, 3, 29.97),
(10, 10, 1, 5.99);

6. DeliveryPersonnel Table

INSERT INTO DeliveryPersonnel (Name, Phone, Status) VALUES


('Tom Carter', '9998887776', 'Available'),
('Jerry Williams', '9997776665', 'Busy'),
('Anna White', '8889991110', 'Available'),
('Sarah Evans', '8882223334', 'Busy'),
('Daniel Scott', '7773334445', 'Available'),
('Olivia Brown', '7774445556', 'Busy'),
('Liam Harris', '6665554443', 'Available'),
('Emma Johnson', '5554443332', 'Busy'),
('Noah Davis', '4443332221', 'Available'),
('Ava Wilson', '3332221110', 'Available');

7. DeliveryAssignments Table

INSERT INTO DeliveryAssignments (OrderID, DeliveryID, AssignedDate, Status) VALUES


(1, 1, '2024-11-17 12:15:00', 'In-Transit'),
(2, 2, '2024-11-17 12:45:00', 'Pending'),
(3, 3, '2024-11-17 13:15:00', 'Delivered'),
(4, 4, '2024-11-17 13:45:00', 'In-Transit'),
(5, 5, '2024-11-17 14:15:00', 'Delivered'),
(6, 6, '2024-11-17 14:45:00', 'Pending'),
(7, 7, '2024-11-17 15:15:00', 'In-Transit'),
(8, 8, '2024-11-17 15:45:00', 'Delivered'),
(9, 9, '2024-11-17 16:15:00', 'Pending'),
(10, 10, '2024-11-17 16:45:00', 'Cancelled');

10
Normalization Processes Used in the Food Ordering System Project

Normalization is the process of organizing data in a database to reduce redundancy and improve data
integrity. Below are the normalization steps applied in the Food Ordering System project.
1. First Normal Form (1NF)
Definition:
A relation is in 1NF if:
1. It contains only atomic (indivisible) values.
2. Each column contains unique values for each row (no repeating groups).
Application in the Project:
Eliminated Repeating Groups:
For example, in the Orders table, instead of storing multiple items in a single row (e.g., Item1, Item2), we
separated these into the OrderDetails table, where each item is represented as a single row.

2. Second Normal Form (2NF)


Definition:
A relation is in 2NF if:
1. It is in 1NF.
2. Every non-prime attribute is fully functionally dependent on the primary key (i.e., no partial dependency).
Application in the Project:
Removed Partial Dependencies:
In the OrderDetails table, attributes such as ItemName and Price were moved to the MenuItems table
because these depend only on ItemID and not the composite key (OrderID, ItemID).

3. Third Normal Form (3NF)


Definition:
A relation is in 3NF if:
1. It is in 2NF.
2. Every non-prime attribute is non-transitively dependent on the primary key (i.e., no transitive
dependency).
Application in the Project:
Removed Transitive Dependencies:
For example, in the Orders table, attributes like CustomerName and CustomerAddress were moved to the
Customers table because these depend on CustomerID rather than OrderID.

11
TABLES
1. Customers

2. Restaurants

3. Menuitems

12
4. Orders

5. OrderDetails

13
6. DeliveryAssignments

7. DeliveryPersonnel

14
Querying the Database:
1. Get All Customers with Their Orders

This query retrieves all customers and their order details, including the restaurant name and order status.

SELECT c.Name AS CustomerName, c.Email, o.OrderID, r.Name AS RestaurantName, o.OrderDate,


o.Status AS OrderStatus, o.TotalAmount FROM Customers c JOIN Orders o ON c.CustomerID =
o.CustomerID JOIN Restaurants r ON o.RestaurantID = r.RestaurantID;

2. Get All Menu Items for a Specific Restaurant

This query gets all menu items for the restaurant with ID 1 (Pizza Palace).

SELECT m.ItemName, m.Description, m.Price FROM MenuItems m WHERE m.RestaurantID = 1;

3. Find All Orders in "In-Progress" Status

This query fetches all orders that are in "In-Progress" status.

SELECT o.OrderID, c.Name AS CustomerName, r.Name AS RestaurantName, o.OrderDate,


o.TotalAmount, o.Status

FROM Orders o JOIN Customers c ON o.CustomerID = c.CustomerID JOIN Restaurants r ON o.RestaurantID


= r.RestaurantID WHERE o.Status = 'In-Progress';

15
4. Get the Total Sales for Each Restaurant

This query calculates the total sales for each restaurant by summing the total amounts of their orders

SELECT r.Name AS RestaurantName, SUM(o.TotalAmount) AS TotalSales FROM Orders o JOIN


Restaurants r ON o.RestaurantID = r.RestaurantID GROUP BY r.RestaurantID;

5. List All Orders with Item Details (Using JOIN with OrderDetails)

This query shows the details of each order, including items ordered, their quantity, and subtotal.

SELECT o.OrderID, c.Name AS CustomerName, m.ItemName, od.Quantity, od.SubTotal FROM


OrderDetails od JOIN Orders o ON od.OrderID = o.OrderID JOIN Customers c ON o.CustomerID =
c.CustomerID JOIN MenuItems m ON od.ItemID = m.ItemID;

16
6. Get the Number of Orders Placed by Each Customer

This query counts the number of orders placed by each customer.

SELECT c.Name AS CustomerName, COUNT(o.OrderID) AS NumberOfOrders FROM Orders o JOIN


Customers c ON o.CustomerID = c.CustomerID GROUP BY c.CustomerID;

7. Find Delivery Personnel with the "Available" Status

This query lists all delivery personnel who are currently available for assignments.

SELECT d.Name AS DeliveryPersonnelName, d.Phone, d.Status FROM DeliveryPersonnel d WHERE


d.Status = 'Available';

17
8. Get Orders and Their Delivery Status

This query retrieves the status of deliveries along with order details.

SELECT o.OrderID, o.OrderDate, o.Status AS OrderStatus, da.Status AS DeliveryStatus FROM Orders o

JOIN DeliveryAssignments da ON o.OrderID = da.OrderID;

9. Get the Most Expensive Menu Item for Each Restaurant

This query returns the most expensive item from each restaurant's menu.

SELECT r.Name AS RestaurantName, m.ItemName, m.Price FROM MenuItems m JOIN Restaurants r ON


m.RestaurantID = r.RestaurantID WHERE m.Price = (SELECT MAX(Price) FROM MenuItems WHERE
RestaurantID = m.RestaurantID);

18
10. Find the Number of Orders and Total Sales for Each Day

This query calculates the number of orders and the total sales for each day.

SELECT DATE(o.OrderDate) AS OrderDate, COUNT(o.OrderID) AS NumberOfOrders,


SUM(o.TotalAmount) AS TotalSales FROM Orders o GROUP BY DATE(o.OrderDate) ORDER BY
OrderDate;

19
CONCLUSION

The Food Ordering System implemented with SQL represents a robust and scalable approach to managing
the various aspects of online food delivery, including customers, restaurants, menu items, orders, delivery
personnel, and assignments. By utilizing relational databases and SQL, this system provides a structured way
to store, manipulate, and retrieve data, facilitating efficient operations for both customers and businesses.
Key Insights and Benefits:
1. Data Organization & Relationships: The use of relational tables, such as Customers, Restaurants,
MenuItems, Orders, OrderDetails, and DeliveryAssignments, ensures that data is well-organized and
interconnected. For example, each order is linked to a specific customer and restaurant, and every
menu item is tied to its respective restaurant. The foreign key constraints ensure data integrity and
maintain consistent relationships between tables.
2. Flexibility & Scalability: The design allows for easy scalability. New customers, restaurants, menu
items, and delivery personnel can be added without requiring significant changes to the structure. As
the system grows, it can handle an increasing number of orders, menu items, and other entities
without impacting performance, provided indexing and optimization techniques are implemented.
3. Comprehensive Reporting: SQL queries provide the ability to generate detailed reports and insights.
For example, reports such as average order amounts per restaurant, most popular items, order
frequency by customers, and total sales per period can be easily generated using aggregate
functions like AVG(), SUM(), COUNT(), and GROUP BY. This empowers restaurant owners,
managers, and stakeholders to make informed decisions about pricing, inventory, customer
engagement, and marketing strategies.
4. Operational Efficiency: The system allows for the effective tracking of orders, from placement to
delivery. Using the Orders and DeliveryAssignments tables, businesses can track the status of orders
in real-time and assign deliveries efficiently to available personnel. This improves order fulfillment
and reduces delays, ultimately enhancing customer satisfaction.
5. Error Prevention & Data Integrity: The relational model ensures that the data remains consistent
and prevents anomalies like duplicate orders or incorrect assignments. By enforcing referential
integrity with foreign keys and constraints (e.g., ensuring each order has a valid customer and
restaurant), the system minimizes the possibility of data corruption.
6. Customization & Further Enhancements: The system can be easily customized to suit different
business needs. For instance, additional features like promo codes, customer ratings, or loyalty points
could be incorporated with minimal changes. Furthermore, integration with external systems (such as
payment gateways or delivery tracking services) can be achieved to enhance the system's capabilities.

20
REFERENCES

1. SQL and Database Fundamentals


 Elmasri, R., & Navathe, S. B. (2015). Fundamentals of Database Systems (7th ed.). Pearson.
 Garcia-Molina, H., Ullman, J. D., & Widom, J. (2008). Database Systems: The Complete
Book (2nd ed.). Prentice Hall.
2. SQL Query Design and Optimization
 Kline, K., & Gough, A. (2017). SQL Performance Explained. CreateSpace Independent
Publishing Platform.
 Mullins, C. S. (2002). Database Administration: The Complete Guide to DBA Practices
and Procedures. Addison-Wesley.
3. SQL and Relational Database Design
 Date, C. J. (2004). An Introduction to Database Systems (8th ed.). Pearson Education.
 Connolly, T., & Begg, C. (2015). Database Systems: A Practical Approach to
Design, Implementation, and Management (6th ed.). Pearson Education.
4. Food Delivery Systems and SQL Database Design
 Hassan, R., & Yusof, R. (2019). Designing a Food Delivery System Using Mobile
Application (Research Paper).
 Kim, B., & Lee, Y. (2016). A Study on the Characteristics of Food Delivery Service Design Using
E- commerce Systems (Journal of E-Commerce Studies).
5. SQL for Transaction Management in Food Ordering Systems
 Garcia-Molina, H., Ullman, J. D., & Widom, J. (2008). Database Systems: The Complete Book
(2nd ed.). Prentice Hall.
Vassiliadis, P., & Koutsoukou-Argyraki, A. (2009). Transaction Management in Relational Databases

21

You might also like