Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SQL Write a SELECT statement then returns two columns from the GLAccounts table:

ID: 3782320 • Letter: S

Question

SQL

Write a SELECT statement then returns two columns from the GLAccounts table: AccountNo and AccountDescription. The result set should have one row for each account number that has never been used. Sort the final result set by AccountNo.
Hint: use an outer join to the InvoiceLineItem table. To code “account number that has never been used” ---- WHERE InvoiceLineItems.AccountNo IS NULL
Here is result set with 54 rows:

Account... AccountDescription 100 Cash 2 110 Accounts Receivable 3 120 Book Inventory 4 162 Capitalized Lease 167 Software 6 181 Book Development 7 200 Accounts Payable 8 206 Royalties Payable 9 221 401K Employee Contributions 10 230 Sales Taxes Payable 11 234 Medicare Taxes Payable 12 235 Income Taxes Payable 13 237 State Payroll Taxes Payable

Explanation / Answer

SELECT AccountNo, AccountDescription FROM GLAccounts FULL OUTERJOIN ON InvoiceLineItem WHERE InvoiceLineItems.AccountNo IS NULL ORDERBY AccountNo;

if you like this answer, please give a thumbs up and if you have some doubt just ask in the comment section below. I will try to help. Cheers