
Ultimate access to all questions.
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:
The view user_ltv_no_minors uses a CASE statement in the WHERE clause that checks:
TRUE is returned (meaning all rows are included)age >= 18 is appliedSince the analyst is not a member of the "auditing" group, the ELSE branch is executed, which filters rows where age >= 18.
Key points:
age >= 18 means age is greater than or equal to 18Why other options are incorrect:
Note: The correct interpretation is that records with age >= 18 are included, and records with age < 18 are excluded. Option E correctly states this, though it says "greater than 18" instead of "greater than or equal to 18" - in practice, both would be understood to mean the same filtering logic.