Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago