For best success on the assignment read over the problems listed below, return to the textbook and make sure you have practiced these concepts and then, be sure to check out the Instructor Tutorials where I have posted additional notes, examples, and videos for the chapters.
Complete the following for 10 points each naming your png files Assignment4No1 (submit both an image and script file) etc.:
- Write a SELECT statement that returns these columns from the Products table:
- The list_price column
- A column that uses the FORMAT function to return the list_price column with 1 digit to the right of the decimal point
- A column that uses the CONVERT function to return the list_price column as a signed integer
- A column that uses the CAST function to return the list_price column as a signed integer
- Write a SELECT statement that returns the following information from the email_address column in the customers table.
- Email address
- The length of the email address with the alias Length
- The location of the @ sign with the alias @
- The email address username (before the @) with the alias Username
- The email address domain (after the @) with the alias Domain
- Write a SELECT statement that returns these columns from the Products table: a) list_price
- discount_percent
- A column named discount_amount that uses the previous two columns to calculate the discount amount and uses the ROUND function to round the result, so it has 2 decimal digits
- Write a SELECT statement that returns these columns from the Orders table:
- The order_id column
- The order_date column
- A column named approx_ship_date thats calculated by adding 2 days to the order_date column
- The ship_date column if it doesnt contain a null value
- A column named days_to_ship that shows the number of days between the order date and the ship date
- When you have this working, add a WHERE clause that retrieves just the orders for March 2018.
- Write a SELECT statement that uses the analytic functions to get the highest and lowest sales by product within each category. Return these columns:
- The category_name column from the Categories table
- The product_name column from the Products table
- A column named total_sales that shows the sum of the sales for each product with sales in the Order_Items table
- A column named highest_sales that uses the FIRST_VALUE function to show the name of the product with the highest sales within each category
- A column named lowest_sales that uses the LAST_VALUE function to show the name of the product with the lowest sales within each category
- Create a view named order_item_products that returns columns from the Orders, Order_Items, and Products tables. Build your view in stages:
- This view should return these columns from the Orders table: order_id, order_date, tax_amount, and ship_date.
- Next, add the product_name column from the Products table.
- Next, add the following from the Order_Items table: item_price, discount_amount, final_price (the discount amount subtracted from the item price), quantity, and item_total (the calculated total for the item).
- Submit the script file of your view and, an image of the view output.

![[Solved] IT2351 Assignment4](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] IT2351 Assignment2](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.