Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL queries: 1. A. Find the name and phone number of each vendor who has a cooperating vendor. Hint: the vendors for whom the field

SQL queries:

1. A. Find the name and phone number of each vendor who has a cooperating vendor. Hint: the vendors for whom the field Cooperating_Vendor_id is not empty

B. Now find additionally the name and phone number of the cooperating vendor. Present these two columns as: cooperating vendor and cooperating vendor phone.

C. Modify the above query to report all vendors. If they are have a cooperating vendor, report their name if not report N/A.

2. A. Find the order date for all the orders of customers who leave in Los Angeles using joins

B. Repeat the same query this time using non-correlated subqueries

C. Repeat the same query this time using correlated subqueries with the IN statement D. Repeat the same query this time using WHERE EXISTS

image text in transcribedimage text in transcribed

VENDOR_CONTACTS 1 VENDOR_ID LAST_NAME FIRST_NAME VENDORT VENDORS I VENDOR_ID I VENDOR_NAME 1 VENDOR_ADDRESS1 0 VENDOR_ADDRESS2 | VENDOR_CITY 1 VENDOR_STATE - VENDOR_ZIP_CODE I VENDOR_PHONE 1 VENDOR_CONTACT_LAST_NAME O VENDOR_CONTACT_FIRST_NAME - DEFAULT_TERMS_ID DEFAULT_ACCOUNT_NUMBER O COOPERATING_VENDOR_ID CUSTOMERS O CUSTOMER_ID 1 CUSTOMER_FIRST_NAME 1 CUSTOMER_LAST_NAME - CUSTOMER_ADDRESS - CUSTOMER_CITY 1 CUSTOMER_STATE 1 CUSTOMER_ZIP 1 CUSTOMER_PHONE CUSTOMER_FAX CUSTOMERSHIPADDRESS_T DOESBUSINESSIN_T EMPLOYEE_T EMPLOYEESKILLS_T GENERAL_LEDGER_ACCOUNTS INVOICE_LINE_ITEMS INVOICES ITEMS ORDER_DETAILS ORDER_T ORDERLINE_T ORDERS 11 ORDER_ID 1 CUSTOMER_ID - ORDER_DATE 1 SHIPPED_DATE

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

More Books

Students also viewed these Databases questions

Question

=+and reduction in force, and intellectual property.

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago