201k views
0 votes
ABC Corp wants to randomly query 20% of all records in the sendable Data Extension for A/B Testing. Which SQL Query should be used for this? Choose 1. A. SELECT TOP 20 PERCENT SubscriberKey, Email FROM CustomerDE ORDER BY NEWID() B. SELECT TOP 20 PERCENT SubscriberKey, Email FROM CustomerDE ORDER BY RANDOM C. SELECT RANDOM 20 PERCENT subscriberkey, EMail FROM CustomerDE

User Lesya
by
7.6k points

1 Answer

3 votes

Final answer:

The SQL query that should be used to randomly query 20% of all records for A/B Testing is: A). SELECT TOP 20 PERCENT SubscriberKey, Email FROM CustomerDE ORDER BY NEWID()

Step-by-step explanation:

A SQL (Structured Query Language) statement is a set of instruction that consists of identifiers, parameters, variables, names, data types, and SQL reserved words that compiles successfully.

In this case, ABC Corp should use the SQL statement "'SELECT TOP 20 PERCENT SubscriberKey, Email FROM CustomerDE ORDER BY NEWID()' to randomly select 20% of records for A/B Testing.

This SQL statement selects the top 20 percent of rows from a Data Extension called CustomerDE.

The rows are ordered randomly by using the NEWID() function, which is important in A/B testing to ensure a representative sample is chosen without any bias.

The description of keywords used in the SQL statement by ABC Corp are:

  • A SELECT statement retrieves zero or more rows from one or more database tables or database views. In most applications, SELECT is the most commonly used data manipulation language (DML) command.
  • The FROM command is used to specify which table to select or delete data from.
  • An ORDER BY clause in SQL specifies that a SQL SELECT statement returns a result set with the rows being sorted by the values of one or more columns.