Murach’s SQL for SQL Server – Exercise 13 – Guaranteed 100% score

Lab Price = $9
Please feel free to send us your queries at: [email protected]
Payment methods

Add to Cart

Buy Now

View Cart


Problem Statement

1. Write a script that declares and sets a variable that’s equal to the total outstanding
balance due. If that balance due is greater than $10,000.00, the script should return a
result set consisting of VendorName, InvoiceNumber, InvoiceDueDate, and Balance
for each invoice with a balance due, sorted with the oldest due date first. If the total
outstanding balance due is less than $10,000.00, return the message “Balance due is
less than $10,000.00.”

2. The following script uses a derived table to return the date and invoice total of the
earliest invoice issued by each vendor. Write a script that generates the same result
set but uses a temporary table in place of the derived table. Make sure your script
tests for the existence of any objects it creates.
USE AP
SELECT VendorName, FirstInvoiceDate, InvoiceTotal
FROM Invoices JOIN
(SELECT VendorID, MIN(InvoiceDate) AS FirstInvoiceDate
FROM Invoices
GROUP BY VendorID) AS FirstInvoice
ON (Invoices.VendorID = FirstInvoice.VendorID AND
Invoices.InvoiceDate = FirstInvoice.FirstInvoiceDate)
JOIN Vendors
ON Invoices.VendorID = Vendors.VendorID
ORDER BY VendorName, FirstInvoiceDate

3. Write a script that generates the same result set as the code shown in example 2, but
uses a view instead of a derived table. Also write the script that creates the view.
Make sure that your script tests for the existence of the view. The view doesn’t need
to be redefined each time the script is executed.

4. Write a script that uses dynamic SQL to return a single column that represents the
number of rows in a particular table in the current database. The script should
automatically choose the user base table that appears first alphabetically. Exclude
system tables, views, and the table named “dtproperties.” Name the column
CountOfTable, where Table is the chosen table name.
Hint: Use one of the information schema views.

Relevant Material
Instructions
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* 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 ***************************************************
Payment Details
Lab Price = $9
Please feel free to send us your queries at: [email protected]
Payment methods

Add to Cart

Buy Now

View Cart

Leave a Reply