0% found this document useful (0 votes)
9 views10 pages

SQL Project

The Coffee Management System (CMS) is a digital platform designed to optimize operations for coffee-related businesses, including sales, inventory, and customer management. It provides SQL queries for various functionalities such as retrieving customer orders, calculating total sales, identifying popular drinks, listing staff involved in orders, and tracking customer spending. The document includes specific SQL examples to illustrate these functionalities.

Uploaded by

vaishudhongade29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views10 pages

SQL Project

The Coffee Management System (CMS) is a digital platform designed to optimize operations for coffee-related businesses, including sales, inventory, and customer management. It provides SQL queries for various functionalities such as retrieving customer orders, calculating total sales, identifying popular drinks, listing staff involved in orders, and tracking customer spending. The document includes specific SQL examples to illustrate these functionalities.

Uploaded by

vaishudhongade29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Coffee shop

management
system
Coffee management system
Introduction:-

 A Coffee Management System (CMS) is a digital


platform or software solution designed to streamline the
processes associated with coffee-related businesses,
including coffee shops, cafes, roasters, and even larger
coffee production operations. The system helps manage
various aspects of coffee production, sales, inventory,
customer relations, and employee management in a
centralized manner.
1: Retrieve all customers who ordered a specific drink .

SELECT DISTINCT c.first_name, c.last_name FROM Customers c JOIN Orders


o ON c.customer_id = o.customer_id JOIN Order_Details od ON o.order_id
= od.order_id WHERE od.drink_id = 3; -- Latte drink_id

Bob Brown
first_name last_name
Get the total sales for a particular day (e.g., November 10, 2024)
Sql.

SELECT SUM(o.total_price) AS total_sales


FROM Orders o WHERE o.order_date =
'2024-11-10';

total_sales
17.00
Find the most popular drink (based on quantity ordered)

SELECT d.name, SUM(od.quantity) AS total_quantity


FROM Order_Details od
JOIN Drinks d ON od.drink_id = d.drink_id
GROUP BY d.name
ORDER BY total_quantity DESC
LIMIT 1;

Espresso 3
name total_quantity
List all staff who were involved in an order on a specific day
Sql

SELECT DISTINCT s.first_name, s.last_name, s.role


FROM Staff s
JOIN Orders o ON s.staff_id = o.staff_id
WHERE o.order_date = '2024-11-10’;

irst_name last_name role

Bob White Cashier

Alice Green Barista


Get the total amount spent by each customer
Sql

SELECT c.first_name, c.last_name, SUM(o.total_price) AS total_spent FROM Customers c JOIN


Orders o ON c.customer_id = o.customer_id GROUP BY c.customer_id;

first_name last_name total_spent


ohn Doe 6.00

Jane Smith 7.50

Bob Brown 3.50


Thank you

You might also like