Question

Write a SELECT statement that returns one row for each general ledger account number that contains...

Write a SELECT statement that returns one row for each general ledger account number that contains three columns: The account_description column from the General_Ledger_Accounts table The count of the items in the Invoice_Line_Items table that have the same account_number. The sum of the line_item_amount columns in the Invoice_Line_Items table that have the same account_number
Return only those rows where the count of line items is greater than 1. This should return 10 rows.
Group the result set by the account_description column. Sort the result set in descending sequence by the sum of the line item amounts.

Homework Answers

Answer #1

SQL QUERY:

SELECT gen_la.account_description, count(*), sum(inoivce_li.line_item_amount)
FROM   general_ledger_accounts glen_a
INNER JOIN invoice_line_items invoice_li ON invoice_li.account_number = gen_la.account_number
GROUP BY gen_la.account_description
HAVING count(*) > 1
ORDER BY SUM(invoice_li.line_item_amount) DESC
Let me know if you have any doubts or if you need anything to change. 

If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions.

Thank You!
===========================================================================
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
in mysql 3. Write a SELECT statement that returns one row for each customer that has...
in mysql 3. Write a SELECT statement that returns one row for each customer that has orders with these columns:   The email_address column from the Customers table   The sum of the item price in the Order_Items table multiplied by the   quantity in the Order_Items table   The sum of the discount amount column in the Order_Items table   multiplied by the quantity in the Order_Items table   Sort the result set in descending sequence by the item price total for each customer.  
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1....
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1. Write a SELECT statement that returns all columns from the Vendors table inner-joined with all columns from the Invoices table. 2. Write a SELECT statement that returns four columns: vendor_name vendor_name from the Vendors table invoice_number invoice_number from the Invoices table invoice_date invoice_date from the Invoices table balance_due invoice_total minus payment_total minus credit_total from the Invoices table The result set should have one row...
1. Write a SELECT statement to count SKUs for each department, i.e., a table of two...
1. Write a SELECT statement to count SKUs for each department, i.e., a table of two columns, departments and their SKU counts. use cape_codd; select department, count(*) from sku_data group by department ; 2. List buyers who is responsible for at least two SKUs, in three columns, department, buyer, sku count. Sort buyers by their department names in ascending order. select department, buyer, count(sku) from sku_data group by buyer ; 3. Write a SQL statement which returns all the orders....
Answer all of the questions true or false: 1. a) If one row in an echelon...
Answer all of the questions true or false: 1. a) If one row in an echelon form for an augmented matrix is [0 0 5 0 0] b) A vector b is a linear combination of the columns of a matrix A if and only if the equation Ax=b has at least one solution. c) The solution set of b is the set of all vectors of the form u = + p + vh where vh is any solution...
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...
True False Select the most correct answer. Question 1 (1 point) Most databases are just in...
True False Select the most correct answer. Question 1 (1 point) Most databases are just in 1NF. Question 1 options: True False Question 2 (1 point) A subquery is always preferred over a join. Question 2 options: True False Question 3 (1 point) A database may consist only of multiple files. Question 3 options: True False Question 4 (1 point) A database may exist without a database management system. Question 4 options: True False Question 5 (1 point) The insert...
Complete a Java program named ARMgr that maintains customer accounts receivable in a database. The code...
Complete a Java program named ARMgr that maintains customer accounts receivable in a database. The code to initialize the CustomerAccountsDB database table and add a set of customer accounts is provided. Finish the code in these 3 methods in CustomerAccountDB.java to update or query the database: -purchase(double amountOfPurchase) -payment(double amountOfPayment) -getCustomerName() Hint: For getCustomerName(), look at the getAccountBalance() method to see an example of querying data from the database. For the purchase() and payment() methods, look at the addCustomerAccount() method...
3.When closing entries are made:Immersive Reader (1 Point) All ledger accounts are closed to start the...
3.When closing entries are made:Immersive Reader (1 Point) All ledger accounts are closed to start the new accounting period. All real accounts are closed but not the nominal accounts. All balance sheet accounts are closed. All temporary accounts are closed but not the permanent accounts. All permanent accounts are closed but not the nominal accounts. 4.A wholesaler is an intermediary that buys products from manufacturers or other wholesalers and sells them to consumers.Immersive Reader (1 Point) True False 5.The Merchandise...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT