
Answer-first summary for fast verification
Answer: All columns will be displayed normally for those records that have an age greater than 17; records not meeting this condition will be omitted.
The view definition includes a CASE statement that checks if the user is a member of the 'auditing' group. If not, it filters records to only include those where the age is 18 or older. Since the analyst is not a member of the 'auditing' group, the query will only return records where age is 18 or older, displaying all columns normally for those records. Records with age less than 18 are omitted. Therefore, the correct answer is A, as it accurately describes the filtering behavior based on the age condition for non-auditing users.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A table named user_ltv is used to create a view for data analysts across teams. Workspace users are organized into groups for ACL-based data access.
The user_ltv table has the schema:
email (STRING)age (INT)ltv (INT)The following view is defined:
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 in the auditing group runs:
SELECT * FROM user_ltv_no_minors
SELECT * FROM user_ltv_no_minors
What results will this query return?
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.