
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
A table named user_ltv is being used to create a view that will be used by data analysts on various teams. Users in the workspace are configured into groups, which are used for setting up data access using ACLs.
The user_ltv table has the following schema: email STRING, age INT, ltv INT
The following view definition is executed:
CREATE VIEW user_ltv_no_minors AS
SELECT email, age, ltv
FROM user_ltv
WHERE
CASE
WHEN is_member("auditing") THEN TRUE
ELSE age >= 18
END
CREATE VIEW user_ltv_no_minors AS
SELECT email, age, ltv
FROM user_ltv
WHERE
CASE
WHEN is_member("auditing") THEN TRUE
ELSE age >= 18
END
An analyst who is not a member of the auditing group executes the following query:
SELECT * FROM user_ltv_no_minors
SELECT * FROM user_ltv_no_minors
Which statement describes the results returned by this query?
A
All columns will be displayed normally for those records that have an age greater than 17; records not meeting this condition will be omitted.
B
All age values less than 18 will be returned as null values, all other columns will be returned with the values in user_ltv.
C
All values for the age column will be returned as null values, all other columns will be returned with the values in user_ltv.
D
All records from all columns will be displayed with the values in user_ltv.
E
All columns will be displayed normally for those records that have an age greater than 18; records not meeting this condition will be omitted.
Explanation:
Why the correct answer is A
The WHERE clause logic is:
CASE
WHEN is_member("auditing") THEN TRUE
ELSE age >= 18
END
CASE
WHEN is_member("auditing") THEN TRUE
ELSE age >= 18
END
auditing groupage >= 18 is appliedage >= 18 is exactly the same as “age greater than 17”So the query returns:
email, age, ltv)age >= 18age < 18 are completely omittedThis is precisely what option A states.
NULL