45.7k views
1 vote
Which of the following queries will display the first and last name of the individual who referred another customer, along with the customer# of the referred customer?

a) SELECT FirstName, LastName, ReferralCustomerID FROM CUSTOMERS WHERE ReferralCustomerID IS NOT NULL;
b) SELECT FirstName, LastName, CustomerID FROM CUSTOMERS WHERE ReferralCustomerID IS NOT NULL;
c) SELECT FirstName, LastName, CustomerID FROM CUSTOMERS WHERE ReferralCustomerID IS NULL;
d) SELECT FirstName, LastName, ReferralCustomerID FROM CUSTOMERS WHERE ReferralCustomerID IS NULL;

1 Answer

5 votes

Final answer:

The correct query to display the referring individual's name and the referred customer's number is 'SELECT FirstName, LastName, CustomerID FROM CUSTOMERS WHERE ReferralCustomerID IS NOT NULL;'.

Step-by-step explanation:

The correct query to display the first and last name of the individual who referred another customer, along with the customer number (CustomerID) of the referred customer is option b):

SELECT FirstName, LastName, CustomerID FROM CUSTOMERS WHERE ReferralCustomerID IS NOT NULL;

This SQL query selects the first and last names from the CUSTOMERS table where the ReferralCustomerID field is not null, implying that the customer was referred by another customer. The CustomerID column will display the identifier of the referred customer.

User LightNight
by
7.8k points