Write an update statement that updates the customeraddresses

Assignment Help PL-SQL Programming
Reference no: EM131463671

SQL Server 2012 Assingment

1. Create a view named CustomerAddresses that shows the shipping and billing addresses for each customer in the MyGuitarShop database.

This view should return these columns from the Customers table: CustomerID, EmailAddress, LastName and FirstName.

This view should return these columns from the Addresses table: BillLine1, BillLine2, BillCity, BillState, BillZip, ShipLine1, ShipLine2, ShipCity, ShipState, and ShipZip. (How will you get the billing address and shipping address separately from the Addresses table? Join the Customers table with the Addresses table twice!)

Write a SELECT statement that returns these columns from the CustomerAddresses view that you created in exercise 1: CustomerID, LastName, FirstName, BillLine1.

2. Write an UPDATE statement that updates the CustomerAddresses view you created in exercise 1 so it sets the first line of the shipping address to "1990 Westwood Blvd." for the customer with an ID of 8.

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

This view should return these columns from the Orders table: OrderID, OrderDate, TaxAmount, and ShipDate.

This view should return these columns from the OrderItems table: ItemPrice, DiscountAmount, FinalPrice (the discount amount subtracted from the item price), Quantity, and ItemTotal (the calculated total for the item).

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

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

Each row should include these columns: ProductName, OrderCount (the number of times the product has been ordered), and OrderTotal (the total sales for the product).

5. Write a SELECT statement that uses the view that you created in exercise 4 to get total sales for the fivehighest revenue products (price x quantity).

Reference no: EM131463671

Questions Cloud

Briefly explain why biologists use sampling : Briefly explain why biologists use sampling, rather than counting all members of the population of interest- What physical and biological factors
Research a system administration task and implement it : Your manager has asked you to research a system administration task and implement it using VBScript. VBScript Decision-Making Statements.
The present value of cash flows is important in : If a firm has low fixed costs relative to all other firms in the same industry, a large change in sales volume (either up or down) would have.
How would you conduct this process redesigning effort : Hospital administrative processes*: A director of administration for a large hospital receives some disturbing news. A recent auditor's report states that 28%.
Write an update statement that updates the customeraddresses : Write an UPDATE statement that updates the CustomerAddresses view you created in exercise 1 so it sets the first line of the shipping address.
Which of the following is not followed in brainstorming : Which of the following grants the owner protection from anyone else making, using and selling the identified innovation?
Fundamental differences between science and non-science : Discuss the fundamental differences between science and non-science, including ?religions/intelligent design/other forms of creationism.
Describe the environmental computer models : Environmental computer models*: An environmental company specializes in developing computer models. The models display the direction of groundwater flow.
Describe benefits and uses of coauthoring and collaboration : Include at least one paragraph describing the benefits and uses of Coauthoring and Collaboration that the organization might utilize with Microsoft Word.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd