Demonstrate mastery of Aggregate functions, grouping, and SQL joins. /* Use the
ID: 3824744 • Letter: D
Question
Demonstrate mastery of Aggregate functions, grouping, and SQL joins. /* Use the Murach AP database to produce the requested result sets. 4. Write a query that returns the total amount invoiced for each Account. 5. Write a query that calculates the number of invoices and the average invoice amount for the vendors in California. 6. Write a query that returns the Sum of the Invoice Totals for Each Vendor 7. Write a query that returns the Average of Invoice Totals for all invoices ordered by region of vendor. */
Explanation / Answer
Aggregate functions perform a calculation on a set of values and return a single value. for grouping the value we used GROUP BY clause.
Example: Select * from employes group by Department
Here Data will show Department wise.
SQL joins: If we have requirement to retrived the data from more than one table than we used join clause.
There are many types of join.
Inner Join
Equi-join
Natural Join
Outer Join
Left outer Join
Right outer join
Full outer join
Cross Join
Self Join
4. Select COUNT(invoice) from Accounts_Details Group by Account
Note: Accounts_Details is table name
5. Select COUNT(invoice),AVG(invoice_amount) from Accounts_Details
Where State = 'California' Group by vendors
6. Select Sum(Invoice ) from Accounts_Details Group by vendors
7. Select avg(Sum(Invoice )) from Accounts_Details
Note: Accounts_Details is table name in all query.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.