Question: Write SQL query and its result based on the records added earlier for the following tasks: (one query per question) List number of food based

 Write SQL query and its result based on the records added

  1. Write SQL query and its result based on the records added earlier for the following tasks: (one query per question)
  1. List number of food based on food menu type
  2. List all food sold by each restaurant with food menu type Western (you may also use the available food menu type inserted earlier)
  3. List all customer details who lives in Kubang Kerian (you may also use the available customer address inserted earlier)
  4. Produce a Total-Purchase information by getting the overall total purchase for food menu type Thai (you may also use the available food menu type inserted earlier)
  5. Update expiry hour for all food sold by restaurant name "KAYUONE" (you may also use the available restaurant name inserted earlier) with additional 2 hours. You are required to show before and after update records.
  6. Display full customer name, food name, food type, food menu type, order date and order price for all order made on the last 30 days
  7. Display full detail of customer, total number of orders made and the overall total order amount made by the customer
  8. Modify the ORDERLIST table by adding in new column entry for additional request made by customer

REQUIREMENT A Food Delivery System allows customer to place food order online and will be delivered by the restaurant via dispatch services. The schema of the database is provided below: CUSTOMER CustID, CustName, CustAddress, CustPhone, CustEmail RESTAURANT RestID, RestName, RestAddress, RestPhone, RestEmail, RestPIC FOOD FoodID, FoodName, FoodType, Food Menutype, FoodExpiry Hour, FoodPrice, RestID ORDERLIST Order_ID, Order Date, OrderQty, Order Amount, FoodID, CustID [Primary key is underlined, foreign key is dotted underlined] Take note: Food type refers to the food main ingredient such as chicken. Food menu type refers to the style of cooking such as western. REQUIREMENT A Food Delivery System allows customer to place food order online and will be delivered by the restaurant via dispatch services. The schema of the database is provided below: CUSTOMER CustID, CustName, CustAddress, CustPhone, CustEmail RESTAURANT RestID, RestName, RestAddress, RestPhone, RestEmail, RestPIC FOOD FoodID, FoodName, FoodType, Food Menutype, FoodExpiry Hour, FoodPrice, RestID ORDERLIST Order_ID, Order Date, OrderQty, Order Amount, FoodID, CustID [Primary key is underlined, foreign key is dotted underlined] Take note: Food type refers to the food main ingredient such as chicken. Food menu type refers to the style of cooking such as western

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!