Question: Database mysql: 1. Write a SELECT statement that returns these column names and data from the Products table: product_name The product_name column list_price The list_price

Database mysql:

1. Write a SELECT statement that returns these column names and data from the Products table:

product_name The product_name column

list_price The list_price column

discount_percent The discount_percent column

discount_amount A column thats calculated from the previous two columns

discount_price A column thats calculated from the previous three columns

Round the discount_amount and discount_price columns to 2 decimal places.

Sort the result set by discount price in descending sequence.

Use the LIMIT clause so the result set contains only the first 5 rows.

2. Write a SELECT statement that returns these column names and data from the Order_Items table:

item_id The item_id column

item_price The item_price column

discount_amount The discount_amount column

quantity The quantity column

price_total A column thats calculated by multiplying the item price by the quantity

discount_total A column thats calculated by multiplying the discount amount by the quantity

item_total A column thats calculated by subtracting the discount amount from the item price and then multiplying by the quantity

Only return rows where the item_total is greater than 500.

Sort the result set by item total in descending sequence.

Work with nulls and test expressions

3. Write a SELECT statement that returns these columns from the Orders table:

order_id The order_id column

order_date The order_date column

ship_date The ship_date column

Return only the rows where the ship_date column contains a null value.

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!