Question
Need some Oracle SQL assistance, please, Write a select statement that returns the same result set as the following SELECT statement but doesnt use a
Need some Oracle SQL assistance, please,
Write a select statement that returns the same result set as the following SELECT statement but doesnt use a JOIN. Instead, use a SUBQUERY in a where clause that uses the IN keyword.
SELECT DISTINCT VENDOR_NAME
FROM VENDORS JOIN INVOICES ON VENDORS.VENDOR_ID = INVLICES.VENDOR_ID
ORDER BY VENDOR_NAME
Write a select statement that answers this question: Which invoices have a payment total thats greater than the average payment total for all paid invoices? Return the invoice number and the invoice total for each invoice.
Write a select statement that returns 2 columns from the General_Ledger_Accounts table: account number and account description. The result set should have one row for each account number that has never been used. Use a subquery introduced with the NOT EXISTS operator. Sort the final result set by account number.
Write a select statement that returns four columns: vendor name, invoice id, invoice sequence, and the line item amount for each invoice that has more than one line item in the Invoice_Line_Items table. Hint: use a subquery that tests for invoice sequence greater than 1.
Write a select statement that returns a single value that represents the sum of the largest unpaid invoices for each vendor (just one for each vendor). Use an inline view that returns the MAX(invoice_total) grouped by vendor_id filtering for invoices with a balance due.
Write a select statement that returns the name, city, and state of each vendor thats located in a unique city and state. In other words, dont include vendors that have a city and state in common with another vendor.
Use a correlated subquery to return one row per vendor, representing the vendors oldest invoice (the one with the earliest date). Each row should include the columns: vendor name, invoice number, invoice date, and the invoice total.
Rewrite the exercise above so it gets the same result without using a correlated subquery.
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