78 SQL Analytics questions from the Data Engineering bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Free to start: the 2-minute IT readiness check — six questions and a result.
A.Function returning 1 or 0 to indicate whether a column was aggregated away in a ROLLUP or CUBE row, used to label subtotal rows.
B.Window function that distributes ordered rows into a specified number of roughly equal buckets, used for quartiles, deciles, and percentiles.
C.Window function that returns a value from a previous row within the partition at a given offset, useful for period-over-period comparisons.
D.Statement combining INSERT, UPDATE, and DELETE in one pass by matching a target table against a source on a join condition, the basis of upserts.
Answer + AI explanation with Pro
2. Which command will Window function that returns a value from a previous row within the partition at a given offset, useful for period-over-period comparisons.?
Junior
A.LAST_VALUE
B.LAG
C.COUNT DISTINCT
D.ROLLUP
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.LAG — Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
B.LAG — Window function that returns a value from a previous row within the partition at a given offset, useful for period-over-period comparisons.
C.LAG — BigQuery function that merges HyperLogLog++ sketches to produce an approximate distinct count across pre-aggregated partitions.
D.LAG — The regular-expression-style clause inside MATCH_RECOGNIZE that names row-pattern variables and quantifiers to match ordered sequences of rows.
Answer + AI explanation with Pro
4. What does LEAD do?
Junior
A.Statement combining INSERT, UPDATE, and DELETE in one pass by matching a target table against a source on a join condition, the basis of upserts.
B.MERGE clause that acts on target rows absent from the source, commonly used to delete or soft-delete rows no longer present upstream.
C.Window function that returns a value from a following row within the partition at a given offset, useful for looking ahead in an ordered series.
D.Clause letting one query compute multiple groupings (subtotals) in a single pass without UNION ALL of separate aggregations.
Answer + AI explanation with Pro
5. Which command will Window function that returns a value from a following row within the partition at a given offset, useful for looking ahead in an ordered series.?
Junior
A.APPROX_QUANTILES
B.WHEN NOT MATCHED BY SOURCE
C.LEAD
D.GROUPS BETWEEN
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.LEAD — A window-function option (e.g. LAST_VALUE ... IGNORE NULLS) that skips null values, commonly used to carry forward the last known non-null value.
B.LEAD — Window frame mode that counts frame boundaries in terms of peer groups (distinct ORDER BY values) rather than individual rows.
C.LEAD — Window function that returns a value from a following row within the partition at a given offset, useful for looking ahead in an ordered series.
D.LEAD — Window-function modifier (for LAG, LEAD, FIRST_VALUE) that skips null values when locating the offset row, useful for carrying forward last-known values.
Answer + AI explanation with Pro
7. What does NTILE do?
Junior
A.Window frame clause that defines the frame by logical value range of the ORDER BY column, grouping peer rows with the same value together.
B.Inverse-distribution function computing a continuous percentile by interpolating between values, returning a value that may not exist in the data.
C.Window function that distributes ordered rows into a specified number of roughly equal buckets, used for quartiles, deciles, and percentiles.
D.Window frame clause that defines the rows in a window by physical row position relative to the current row, e.g. 2 PRECEDING to CURRENT ROW.
Answer + AI explanation with Pro
8. Which command will Window function that distributes ordered rows into a specified number of roughly equal buckets, used for quartiles, deciles, and percentiles.?
Junior
A.MERGE
B.NTILE
C.LAG
D.CUBE
Answer + AI explanation with Pro
9. Which statement is correct?
Junior
A.NTILE — Clause (Snowflake, BigQuery, Databricks) that filters rows based on the result of a window function, avoiding a wrapping subquery.
B.NTILE — Aggregate that counts unique values; on big data often approximated with APPROX_COUNT_DISTINCT (HyperLogLog) for speed.
C.NTILE — Window frame clause that defines the rows in a window by physical row position relative to the current row, e.g. 2 PRECEDING to CURRENT ROW.
D.NTILE — Window function that distributes ordered rows into a specified number of roughly equal buckets, used for quartiles, deciles, and percentiles.
Answer + AI explanation with Pro
10. What does FIRST_VALUE do?
Junior
A.Inverse-distribution function returning the discrete value at the requested percentile, always an actual value present in the dataset.
B.Window frame clause that defines the frame by logical value range of the ORDER BY column, grouping peer rows with the same value together.
C.Window frame clause that defines the rows in a window by physical row position relative to the current row, e.g. 2 PRECEDING to CURRENT ROW.
D.Window function returning the first value in an ordered window frame, often used to fetch the earliest event per partition.
Answer + AI explanation with Pro
11. Which command will Window function returning the first value in an ordered window frame, often used to fetch the earliest event per partition.?
Junior
A.RANGE BETWEEN
B.FIRST_VALUE
C.IGNORE NULLS
D.PERCENTILE_DISC
Answer + AI explanation with Pro
12. Which statement is correct?
Junior
A.FIRST_VALUE — Window function that returns a value from a previous row within the partition at a given offset, useful for period-over-period comparisons.
B.FIRST_VALUE — Window function returning the first value in an ordered window frame, often used to fetch the earliest event per partition.
C.FIRST_VALUE — Window function that returns a value from a following row within the partition at a given offset, useful for looking ahead in an ordered series.
D.FIRST_VALUE — Window frame clause that defines the frame by logical value range of the ORDER BY column, grouping peer rows with the same value together.
Answer + AI explanation with Pro
13. What does LAST_VALUE do?
Junior
A.Window-function modifier (for LAG, LEAD, FIRST_VALUE) that skips null values when locating the offset row, useful for carrying forward last-known values.
B.Aggregate that counts unique values; on big data often approximated with APPROX_COUNT_DISTINCT (HyperLogLog) for speed.
C.Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
D.Clause (Snowflake, BigQuery, Databricks) that filters rows based on the result of a window function, avoiding a wrapping subquery.
Answer + AI explanation with Pro
14. Which command will Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.?
Junior
A.PERCENTILE_DISC
B.LATERAL FLATTEN
C.MERGE
D.LAST_VALUE
Answer + AI explanation with Pro
15. Which statement is correct?
Junior
A.LAST_VALUE — BigQuery function returning approximate percentile boundaries from a sketch, far cheaper than exact percentiles on large data.
B.LAST_VALUE — Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
C.LAST_VALUE — GROUP BY extension producing subtotals for every possible combination of the grouped columns, a full cross-tabulation.
D.LAST_VALUE — A window-function option (e.g. LAST_VALUE ... IGNORE NULLS) that skips null values, commonly used to carry forward the last known non-null value.
Answer + AI explanation with Pro
16. What does PERCENTILE_CONT do?
Mid
A.Window-function modifier (for LAG, LEAD, FIRST_VALUE) that skips null values when locating the offset row, useful for carrying forward last-known values.
B.Window frame clause that defines the frame by logical value range of the ORDER BY column, grouping peer rows with the same value together.
C.Snowflake pattern combining a LATERAL join with the FLATTEN table function to explode semi-structured VARIANT arrays into one row per element.
D.Inverse-distribution function computing a continuous percentile by interpolating between values, returning a value that may not exist in the data.
Answer + AI explanation with Pro
17. Which command will Inverse-distribution function computing a continuous percentile by interpolating between values, returning a value that may not exist in the data.?
Mid
A.GROUPING SETS
B.PERCENTILE_CONT
C.FIRST_VALUE
D.RANGE BETWEEN
Answer + AI explanation with Pro
18. Which statement is correct?
Mid
A.PERCENTILE_CONT — Window function that distributes ordered rows into a specified number of roughly equal buckets, used for quartiles, deciles, and percentiles.
B.PERCENTILE_CONT — Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
C.PERCENTILE_CONT — The regular-expression-style clause inside MATCH_RECOGNIZE that names row-pattern variables and quantifiers to match ordered sequences of rows.
D.PERCENTILE_CONT — Inverse-distribution function computing a continuous percentile by interpolating between values, returning a value that may not exist in the data.
Answer + AI explanation with Pro
19. What does PERCENTILE_DISC do?
Mid
A.Inverse-distribution function returning the discrete value at the requested percentile, always an actual value present in the dataset.
B.Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
C.Snowflake pattern combining a LATERAL join with the FLATTEN table function to explode semi-structured VARIANT arrays into one row per element.
D.BigQuery function returning approximate percentile boundaries from a sketch, far cheaper than exact percentiles on large data.
Answer + AI explanation with Pro
20. Which command will Inverse-distribution function returning the discrete value at the requested percentile, always an actual value present in the dataset.?
Mid
A.PERCENTILE_DISC
B.HLL_COUNT.MERGE
C.GROUPING
D.LAST_VALUE
Answer + AI explanation with Pro
21. Which statement is correct?
Mid
A.PERCENTILE_DISC — Statement combining INSERT, UPDATE, and DELETE in one pass by matching a target table against a source on a join condition, the basis of upserts.
B.PERCENTILE_DISC — Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
C.PERCENTILE_DISC — Window frame mode that counts frame boundaries in terms of peer groups (distinct ORDER BY values) rather than individual rows.
D.PERCENTILE_DISC — Inverse-distribution function returning the discrete value at the requested percentile, always an actual value present in the dataset.
Answer + AI explanation with Pro
22. What does GROUPING SETS do?
Mid
A.Inverse-distribution function computing a continuous percentile by interpolating between values, returning a value that may not exist in the data.
B.Clause letting one query compute multiple groupings (subtotals) in a single pass without UNION ALL of separate aggregations.
C.Window function returning the first value in an ordered window frame, often used to fetch the earliest event per partition.
D.Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
Answer + AI explanation with Pro
23. Which command will Clause letting one query compute multiple groupings (subtotals) in a single pass without UNION ALL of separate aggregations.?
Mid
A.APPROX_QUANTILES
B.CUBE
C.GROUPING SETS
D.LAG
Answer + AI explanation with Pro
24. Which statement is correct?
Mid
A.GROUPING SETS — Clause (Snowflake, BigQuery, Databricks) that filters rows based on the result of a window function, avoiding a wrapping subquery.
B.GROUPING SETS — Aggregate that counts unique values; on big data often approximated with APPROX_COUNT_DISTINCT (HyperLogLog) for speed.
C.GROUPING SETS — Clause letting one query compute multiple groupings (subtotals) in a single pass without UNION ALL of separate aggregations.
D.GROUPING SETS — Function returning 1 or 0 to indicate whether a column was aggregated away in a ROLLUP or CUBE row, used to label subtotal rows.
Answer + AI explanation with Pro
25. What does ROLLUP do?
Mid
A.Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
B.Window function that returns a value from a previous row within the partition at a given offset, useful for period-over-period comparisons.
C.A window-function option (e.g. LAST_VALUE ... IGNORE NULLS) that skips null values, commonly used to carry forward the last known non-null value.
D.GROUP BY extension producing hierarchical subtotals and a grand total across a left-to-right ordered list of columns.
Answer + AI explanation with Pro
26. Which command will GROUP BY extension producing hierarchical subtotals and a grand total across a left-to-right ordered list of columns.?
Mid
A.ROLLUP
B.ROWS BETWEEN
C.PERCENTILE_DISC
D.GROUPING
Answer + AI explanation with Pro
27. Which statement is correct?
Mid
A.ROLLUP — Window-function modifier (for LAG, LEAD, FIRST_VALUE) that skips null values when locating the offset row, useful for carrying forward last-known values.
B.ROLLUP — Window function returning the first value in an ordered window frame, often used to fetch the earliest event per partition.
C.ROLLUP — GROUP BY extension producing hierarchical subtotals and a grand total across a left-to-right ordered list of columns.
D.ROLLUP — BigQuery function that merges HyperLogLog++ sketches to produce an approximate distinct count across pre-aggregated partitions.
Answer + AI explanation with Pro
28. What does CUBE do?
Mid
A.Window function returning the last value in an ordered window frame; needs an explicit frame (ROWS BETWEEN ... AND UNBOUNDED FOLLOWING) to behave as expected.
B.Snowflake pattern combining a LATERAL join with the FLATTEN table function to explode semi-structured VARIANT arrays into one row per element.
C.GROUP BY extension producing subtotals for every possible combination of the grouped columns, a full cross-tabulation.
D.BigQuery function returning approximate percentile boundaries from a sketch, far cheaper than exact percentiles on large data.
Answer + AI explanation with Pro
29. Which command will GROUP BY extension producing subtotals for every possible combination of the grouped columns, a full cross-tabulation.?
Mid
A.APPROX_COUNT_DISTINCT
B.ROLLUP
C.COUNT DISTINCT
D.CUBE
Answer + AI explanation with Pro
30. Which statement is correct?
Mid
A.CUBE — Aggregate that counts unique values; on big data often approximated with APPROX_COUNT_DISTINCT (HyperLogLog) for speed.
B.CUBE — Function returning 1 or 0 to indicate whether a column was aggregated away in a ROLLUP or CUBE row, used to label subtotal rows.
C.CUBE — GROUP BY extension producing subtotals for every possible combination of the grouped columns, a full cross-tabulation.
D.CUBE — Window function that returns a value from a following row within the partition at a given offset, useful for looking ahead in an ordered series.
Answer + AI explanation with Pro
Showing 30 of 78 SQL Analytics questions — the full set, with answers, explanations and an AI tutor on every question, is inside.
Free to start
Start with a free readiness check
Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every SQL Analytics question come with Pro.