Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a SELECT statement that returns one row for each musician that has orders with these columns: The email_address column from the Musicians table A

  1. Write a SELECT statement that returns one row for each musician that has orders with these columns:

The email_address column from the Musicians table

A count of the number of orders

The total amount for each order (Hint: First, subtract the discount amount from the price. Then, multiply by the quantity.)

Return only those rows where the musician has more than 1 order.

Sort the result set in descending sequence by the sum of the line item amounts.

  1. Modify the solution to exercise 1 so it only counts and totals line items that have an item_price value thats greater than 400.

Database Schema: ------------------------------ Tables: musicians, orders, order_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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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