PROJECT Complete Queries
PROJECT Complete Queries
Group Members
No. Student Number Student Name
1 21-1831 ASUNCION,DANICA - LEADER
2 21-1834 DURAN,MARK ANGELO TONIL
3 21-1818 SALEM,EDELYN
4 21-1830 BALDERAMA, BEVERLY
Description:
Burger Ordering System is the program that allows the users to select their orders
burger, beverage, dessert. This program is user friendly; it is easy to use and
creates orders from customers. An online food ordering system allows your
business to accept and manage orders placed online for delivery or takeaway.
Customers browse a digital menu, either on an app or website and place and pay
for their order online. Venues will then receive the order details via their chosen
online food ordering system and produce the order ready for delivery or customer
pickup.
Business Rules:
For every order, the customer must provide name and a local phone number. For
deliveries, the customer must provide name, a local phone number and address.
Shipping fee must be shouldered by customers. A customer receives a 5%
discount if they buy more than 10 products. Listing the order Information of a
customer.
ER DIAGRAM;
CUSTOMER
Column Type Length Decimal Null Description
Places Allowed?
PRODUCTS
ORDER_DETAILS
TRANSACTIONS
Column Type Length Decimal Null Description
Places Allowed?
TRANSACTION_CODE CHAR 10 NO Transaction code
(Primary key)
CUSTOMER_ID CHAR 10 YES Foreign Key to
Customer table
(Customer id)
ORDER_NO CHAR 10 YES Foreign Key to order
details (order no)
PAYMENT CHAR 10 NO Payment must have
(GCASH, CASH)
DELIVERIES
ProjQuery-1. `
display the transactions from the details of the customer. The output from the transaction
and order number and ordered quantity of the customer must be performed. The output from
the transaction code must be in ascending order. The purpose of this query is to show the
transaction of the customer and show their order details.
order by (qty)
Part2
select Deliveries.delivery_id, customers.customer_name,
customers.customer_address, deliveries.delivery_date
order by (delivery_date)
ProjQuery-2.
SELECT order_no ,MAX(qty) FROM Order_details
WHERE qty = 2
GROUP BY order_no
HAVING MAX(qty) = 2
ORDER BY MAX(qty) ASC;
Part 2.
UPDATE customers
SET customer_name = 'BEVERLY'
WHERE customer_id IN
(
SELECT customer_id
FROM customers
WHERE customer_name = 'HARPER'
)
Part 2:
UPDATE products
SET no_of_stock = 1300
WHERE product_code IN
(
SELECT product_code
FROM products
WHERE product_name = 'PIZZA'
)
ProjQuery-4.
Part 2.
ProjQuery-5.
select deliveries.delivery_id, customers.customer_address as "Delivery Address" from
deliveries
join customers on(deliveries.customer_id = customers.customer_id)
where delivery_date > '01-FEB-22'
Part 2.
ProjQuery-6.
ProjQuery-7.
Part 2: