Question: Write a SELECT statement that answers this question: What is the total amount ordered for each instrument? Return these columns: The instrument_name column from the

  1. Write a SELECT statement that answers this question: What is the total amount ordered for each instrument? Return these columns:

The instrument_name column from the Instruments table

The total amount for each instrument in the order_instruments table (Hint: You can calculate the total amount by subtracting the discount amount from the item price and then multiplying it by the quantity)

Use the WITH ROLLUP operator to include a row that gives the grand total.

Note: Once you add the WITH ROLLUP operator, you may need to use MySQL Workbenchs Execute SQL Script button instead of its Execute Current Statement button to execute this statement. Database Schema: ------------------------------ Tables: musicians, orders, order_instruments, instruments Table columns ----------------------- musicians: musician_id, email_address, password, first_name, last_name, shipping_address_id, billing_address_id orders: order_id, musician_id, order_date, ship_amount, tax_amount, ship_date, ship_address_id, card_type, card_number, card_expires, billing_address_id order_instruments: item_id, order_id, instrument_id, item_price, discount_amount, quantity

instruments: instrument_id, category_id, instrument_code, instrument_name, description, list_price, discount_percent, date_added

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!