110k views
4 votes
A consultant needs to send an email to subscribers who have made a purchase. The data used for the send exists on two data extensions--Subscribers and OrderTable, and the customer would like to include key information from both tables, such as:

• CustomerlD
• FirstName
• EmailAddress
• OrderlD
• OrderDate
• ShippedDate

Which SQL statement should the consultant use?

A. SELECT T1.CustomerID, T1.FirstName, T1. EmailAddress, T2.OrderlD, T2.0rderDate, T2.ShippedDate FROM ' Subscribers OUTER JOIN OrderTable ON Subscribers.CustomerlD=OrderTable.CustomerlD

B. SELECT * FROM Subscribers WHERE CustomerlD, FirstName, EmailAddress, OrderlD, OrderDate, ShippedDate - JOIN OrderTable On CustomerlD=CustomerlD

C. SELECT CustomerlD, FirstName, EmailAddress, OrderlD, OrderDate, ShippedDate FROM Subscribers INNER JOIN OrderTable ON CustomerlD=CustomerlD

D. SELECT T1.CustomerID, T1.FirstName, T1.EmailAddress, T2.OrderlD, T2.OrderDate, T2.ShippedDate FROM Subscribers T1 INNER JOIN OrderTable T2 ON T1.CustomerID=T2.CustomerID

User Richy
by
7.7k points

1 Answer

1 vote

Final answer:

The appropriate SQL statement to combine key information from the Subscribers and OrderTable data extensions is option D, which employs an INNER JOIN on the CustomerID. The correct option is D.

Step-by-step explanation:

The correct SQL statement that the consultant should use to include key information from both the Subscribers and OrderTable data extensions is:

D. SELECT T1.CustomerID, T1.FirstName, T1.EmailAddress, T2.OrderID, T2.OrderDate, T2.ShippedDate FROM Subscribers T1 INNER JOIN OrderTable T2 ON T1.CustomerID=T2.CustomerID

This statement uses an INNER JOIN to combine rows from both tables where the condition (the CustomerID matches between Subscribers and OrderTable) is true. It specifies the necessary columns from both tables, and it aliases the Subscribers table as T1 and the OrderTable as T2 for easier referencing of columns.

User Harshal Wani
by
8.4k points

No related questions found