119k views
2 votes
Which of the following SQL statements will display all customers who have not recently placed an order? a. SELECT customer# FROM customers UNION b. SELECT customer# FROM orders; SELECT customer# FROM orders MINUS c. SELECT customer# FROM customers; SELECT customer# FROM orders INTERSECT d. SELECT customer# FROM customers; SELECT customer# FROM customers MINUS

User Whoblitz
by
3.4k points

1 Answer

4 votes

Answer:

The correct option is option 4 from the options indicated below:

Step-by-step explanation:

The options are as given below

1-SELECT customer# FROM customers

UNION

SELECT customer# FROM orders;

2-SELECT customer# FROM orders

MINUS

SELECT customer# FROM customers;

3-SELECT customer# FROM orders

INTERSECT

SELECT customer# FROM customers;

4-SELECT customer# FROM customers

MINUS

SELECT customer# FROM orders;

Option 1 is not correct as it will provide the list of all the customers whether they have placed order or not.

Option 2 is not correct as it will provide the list of customers who have placed order but are not in the customers table. This will return the empty records.

Option 3 is not correct as it will provide the list of customers who have placed the order.

Option 4 is correct as it will provide the list of customers from the CUSTOMERS table which are not in the Orders table. thus the list of customers who have not placed the order yet.