Write a SELECT statement that uses aggregate window functions to calculate the order total for each
musician and the order total for each musician by date. Return these columns:
The musician_id column from the Orders table
The order_date column from the Orders table
The total amount for each order item in the Order_Items table
The sum of the order totals for each musician
The sum of the order totals for each musician by date
(Hint: You can create a peer group to get
these values)
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
Here is the solution. Please do upvote thank you.
Get Answers For Free
Most questions answered within 1 hours.