Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

List the lunch ID, lunch date, the count of menu items per purchased lunch, and the total price of a purchased lunch per lunch

List the lunch ID, lunch date, the count of menu items per purchased lunch, and the total price of a Lunches DB ERD FOOD PF* supplier_id P * product_code menu_item description price price_upcharge FOOD SUPPLIER 

List the lunch ID, lunch date, the count of menu items per purchased lunch, and the total price of a purchased lunch per lunch id. Only include lunch dates from the second half of May 2021 (May 16, 2021 - May 31, 2021). Label the total price expression as TOTAL_PRICE and the count of items as COUNT. Format the TOTAL_PRICE in currency format. Sort by the lunch date, then the lunch id. Type 'col TOTAL_PRICE format $9999.99' in the first line to format the TOTAL_PRICE in currency format, then write your query start in the second line. This involves 3 tables and 2 relationships. LUNCH, LUNCH_ITEM, FOOD tables Note again that FOOD to LUNCH_ITEM is a composite PK relationship. Group by the non-aggregated columns from the SELECT clause. 13 rows selected. Lunches DB ERD FOOD PF* supplier_id P * product_code menu_item description price price_upcharge FOOD SUPPLIER supplier_id supplier_name supplier_city HI- - LUNCH_ITEM P item_number PF* lunch_id F supplier_id F product_code quantity 3 DEPARTMENT dept_code department_name HI- 1- ||+ IF LUNCH X F worker_id lunch_id lunch_date WORKER * worker_id first_name last_name city hire_date credit limit phone_number manager_id dept_code

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

Step: 1

Answer col TOTALPRICE format 999999 SELECT LLUNCHID LLUNCHDATE COUNTL... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

Which other character brings out a particular part? And why?

Answered: 1 week ago