subject

1. Create a view named customer_addresses that shows the shipping and billing addresses for each customer.

This view should return these columns from the Customers table: customer_id, email_address, last_name and first_name.

This view should return these columns from the Addresses table: bill_line1, bill_line2, bill_city, bill_state, bill_zip, ship_line1, ship_line2, ship_city, ship_state, and ship_zip.

The rows in this view should be sorted by the last_name and then first_name columns.

2. Write a SELECT statement that returns these columns from the customer_addresses view that you created in exercise 1: customer_id, last_name, first_name, bill_line1.

3. Create a view named order_item_products that returns columns from the Orders, Order_Items, and Products tables.

This view should return these columns from the Orders table: order_id, order_date, tax_amount, and ship_date.

This view should return these columns 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).

This view should return the product_name column from the Products table.

4. Create a view named product_summary that uses the view you created in exercise 4. This view should return summary information about each product.

Each row should include product_name, order_count (the number of times the product has been ordered) and order_total (the total sales for the product).

5. Write a SELECT statement that uses the view that you created in exercise 5 to get total sales for the five best selling products.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:40
1. the program must provide following functions to extract some statistics. note that the data_list parameter specified in these functions may be the same for all functions or different for different functions—that is your choice. a skeleton file is provided on mirmir. a) open_file()prompts the user to enter a year number for the data file. the program will check whether the year is between 1990 and 2015 (both inclusive). if year number is valid, the program will try to open data file with file name ‘year.txt’, where is the year. appropriate error message should be shown if the data file cannot be opened or if the year number is invalid. this function will loop until it receives proper input and successfully opens the file. it returns a file pointer and year. i. hint: use string concatenation to construct the file name b) read_file(fp)has one parameter, a file pointer read. this function returns a list of your choosing containing data you need for other parts of this project. c) find_average(data_list) takes a list of data (of some organization of your choosing) and returns the average salary. the function does not print anything. hints: i. this is not the average of the last column of data. it is not mathematically valid to find an average by finding the average of averages—for example, in this case there are many more in the lowest category than in the highest category. ii. how many wage earners are considered in finding the average (denominator)
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 22.06.2019 11:10
Which are not examples of chronic or persistent stress? moving
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
You know the right answer?
1. Create a view named customer_addresses that shows the shipping and billing addresses for each cus...
Questions
question
History, 10.08.2021 22:00
question
Mathematics, 10.08.2021 22:00
Questions on the website: 13722362