Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IS 2 7 6 DB MODULE 5 Correct Table Joins and Join Fields & Summary Queries USE AP Vendors to Invoices ( on VendorID )
ISDB MODULE
Correct Table Joins and Join Fields & Summary Queries
USE AP
Vendors to Invoices on VendorID
Invoices to InvoiceLineItems on InvoiceID
InvoiceLineItems to GLAccounts on AccountNo
Write a select statement that returns columns from the Invoices table:
InvoiceCount and AvgInvAmount. InvoiceCount is the count of the number of
invoices and AvgInvAmount is the average of the InvoiceTotal column.
Write a select statement that returns columns from the Invoices table:
VendorID and BalanceDue. BalanceDue is the sum of invoices with a balance
due. Filter the results to only return rows where a balance is due. Group the
results by VendorID.
Write a select statement that returns columns from the Invoices table:
VendorID, InvoiceCount, and TotalPaid. InvoiceCount is the count of the
number of invoices, and TotalPaid is the sum of the PaymentTotal and
CreditTotal columns added together. Filter the results to only return rows
where the balance due is equal to zero. Group the results by VendorID.
Write a select statement that returns columns: VendorName, InvCount,
LargestInv, SmallestInv, AverageInv and TotalInv:
InvCount: Count of the number of invoices
LargestInv: Highest value in the InvoiceTotal column
SmallestInv: Lowest value in the InvoiceTotal column
AverageInv: Average value in the InvoiceTotal column TotalInv:
Sum of the InvoiceTotal column
Group the results by VendorName.
Write a select statement that returns columns: VendorState, VendorCity,
TotalInvoices, and LargestInvoice:
TotalInvoices: Count of the number of invoices
LargestInvoice: Highest value in the InvoiceTotal column
Filter the results using a HAVING clause to only return rows where the
LargestInvoice is greater than $ Group and sort the results by VendorState
and VendorCity.
Write a select statement that returns columns: VendorCity, InvoiceDate,
InvoiceCount and InvoiceSum:
InvoiceCount: Count of the number of invoices InvoiceSum:
Sum of the InvoiceTotal column
Add a compound condition in a HAVING clause that filters the results to only
return rows that match these conditions:
The InvoiceDate is in the range of to
The InvoiceSum is greater than $
The InvoiceCount is greater than
Write a select statement that returns columns: VendorName, InvoiceCount,
InvoiceTotal, TotalPayments, TotalCredits, and BalanceDue:
InvoiceCount: Count of the number of invoices
InvoiceTotal: Sum of the InvoiceTotal column
TotalPayments: Sum of the PaymentTotal column
TotalCredits: Sum of the CreditTotal column
BalanceDue: Sum of Invoices with a balance due
Group the results by VendorName and include the operator necessary to add
a summary row for each of the columns.
Write a select statement that returns columns: VendorName, TotalInvAmt,
LineItemTotal and LineItemCount:
TotalInvAmt: Sum of the InvoiceTotal column
LineItemTotal: Sum of the InvoiceLineItemAmount column
LineItemCount: Count of entries in InvoiceLineItemAmount column
Filter the results to only return rows where VendorName starts with the letters
D through U Group the results by VendorName and using a HAVING clause,
further filter the results to only return rows where the TotalInvAmt is greater
than $
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started