Murach’s SQL for SQL Server – Exercise 12 – Guaranteed 100% score
1. Write a CREATE VIEW statement that defines a view named InvoiceBasic that
returns three columns: VendorName, InvoiceNumber, and InvoiceTotal. Then, write
a SELECT statement that returns all of the columns in the view, sorted by
VendorName, where the first letter of the vendor name is N, O, or P.
2. Create a view named Top10PaidInvoices that returns three columns for each vendor:
VendorName, LastInvoice (the most recent invoice date), and SumOfInvoices (the
sum of the InvoiceTotal column). Return only the 10 vendors with the largest
SumOfInvoices and include only paid invoices.
3. Create an updatable view named VendorAddress that returns the VendorID, both
address columns, and the city, state, and zip code columns for each vendor. Then,
write a SELECT query to examine the result set where VendorID=4. Next, write an
UPDATE statement that changes the address so that the suite number (Ste 260) is
stored in VendorAddress2 rather than in VendorAddress1. To verify the change,
rerun your SELECT query.
4. (If you’ve done exercise 10-5) Query each of the four information schema views
listed in figure 12-9 of the text that return information about constraints. Which of
these four views returns the code for a check constraint clause? What is the name of
the column in which the code is returned?
5. Using the Enterprise Manager, create a view named AccountByVendor that returns
the sum of InvoiceLineItemAmounts in the InvoiceLineItems table, grouped by
VendorName and AccountDescription. Check the joins that are automatically coded
in the FROM clause to be sure they’re correct.
6. Using the Enterprise Manager, modify the InvoiceBasic view created in exercise 1 to
sort the result set by VendorName. What clause does the system automatically code
to allow the use of an ORDER BY clause in the view?
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at [email protected].
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************