78 real Advanced SQL questions from the Data Engineering bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.
1. What does LATERAL do?
Mid
A.Aggregate clause (FILTER (WHERE ...)) applying a per-aggregate condition, a cleaner alternative to CASE expressions inside aggregates.
B.The ROWS or RANGE specification defining which rows around the current row a window aggregate sees; RANGE is value-based while ROWS is positional.
C.Join keyword allowing a subquery on the right side to reference columns from tables on its left, enabling row-by-row correlated joins.
D.SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
2. Which command will Join keyword allowing a subquery on the right side to reference columns from tables on its left, enabling row-by-row correlated joins.?
A.LATERAL — Operator that rotates columns back into rows, converting a wide cross-tab into long key-value format.
B.LATERAL — Join keyword allowing a subquery on the right side to reference columns from tables on its left, enabling row-by-row correlated joins.
C.LATERAL — The ROWS or RANGE specification defining which rows around the current row a window aggregate sees; RANGE is value-based while ROWS is positional.
D.LATERAL — SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
A.Operator that rotates columns back into rows, converting a wide cross-tab into long key-value format.
B.Snowflake table function that explodes a VARIANT, ARRAY, or OBJECT into rows, the semi-structured-data equivalent of unnesting.
C.Join that pairs each left row with rows produced by a lateral subquery depending on that row, often used to expand arrays or call table functions per row.
D.Join keyword allowing a subquery on the right side to reference columns from tables on its left, enabling row-by-row correlated joins.
5. Which command will Join that pairs each left row with rows produced by a lateral subquery depending on that row, often used to expand arrays or call table functions per row.?
A.CROSS JOIN LATERAL — The ROWS or RANGE specification defining which rows around the current row a window aggregate sees; RANGE is value-based while ROWS is positional.
B.CROSS JOIN LATERAL — SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
C.CROSS JOIN LATERAL — Operator that rotates distinct values of a column into separate columns, turning long-format rows into a wide cross-tab.
D.CROSS JOIN LATERAL — Join that pairs each left row with rows produced by a lateral subquery depending on that row, often used to expand arrays or call table functions per row.
A.Join that pairs each left row with rows produced by a lateral subquery depending on that row, often used to expand arrays or call table functions per row.
B.Operator that flattens an array or repeated column into one row per element, the standard way to explode nested data in BigQuery and Snowflake.
C.Function returning the first non-null argument from a list, used to supply defaults and combine fallback columns.
D.Snowflake table function that explodes a VARIANT, ARRAY, or OBJECT into rows, the semi-structured-data equivalent of unnesting.
8. Which command will Operator that flattens an array or repeated column into one row per element, the standard way to explode nested data in BigQuery and Snowflake.?
A.UNNEST — Join that pairs each left row with rows produced by a lateral subquery depending on that row, often used to expand arrays or call table functions per row.
B.UNNEST — Join keyword allowing a subquery on the right side to reference columns from tables on its left, enabling row-by-row correlated joins.
C.UNNEST — The ROWS or RANGE specification defining which rows around the current row a window aggregate sees; RANGE is value-based while ROWS is positional.
D.UNNEST — Operator that flattens an array or repeated column into one row per element, the standard way to explode nested data in BigQuery and Snowflake.
11. Which command will Snowflake table function that explodes a VARIANT, ARRAY, or OBJECT into rows, the semi-structured-data equivalent of unnesting.?
A.FLATTEN — Snowflake table function that explodes a VARIANT, ARRAY, or OBJECT into rows, the semi-structured-data equivalent of unnesting.
B.FLATTEN — Operator that flattens an array or repeated column into one row per element, the standard way to explode nested data in BigQuery and Snowflake.
C.FLATTEN — Function returning the first non-null argument from a list, used to supply defaults and combine fallback columns.
D.FLATTEN — Operator that rotates distinct values of a column into separate columns, turning long-format rows into a wide cross-tab.
A.Operator that rotates columns back into rows, converting a wide cross-tab into long key-value format.
B.SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
C.Aggregate clause (FILTER (WHERE ...)) applying a per-aggregate condition, a cleaner alternative to CASE expressions inside aggregates.
D.Operator that rotates distinct values of a column into separate columns, turning long-format rows into a wide cross-tab.
14. Which command will SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.?
A.MATCH_RECOGNIZE — Operator that rotates distinct values of a column into separate columns, turning long-format rows into a wide cross-tab.
B.MATCH_RECOGNIZE — SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
C.MATCH_RECOGNIZE — Join keyword allowing a subquery on the right side to reference columns from tables on its left, enabling row-by-row correlated joins.
D.MATCH_RECOGNIZE — Operator that rotates columns back into rows, converting a wide cross-tab into long key-value format.
A.Join that pairs each left row with rows produced by a lateral subquery depending on that row, often used to expand arrays or call table functions per row.
B.Operator that rotates distinct values of a column into separate columns, turning long-format rows into a wide cross-tab.
C.Aggregate clause (FILTER (WHERE ...)) applying a per-aggregate condition, a cleaner alternative to CASE expressions inside aggregates.
D.Join keyword allowing a subquery on the right side to reference columns from tables on its left, enabling row-by-row correlated joins.
A.PIVOT — A WITH RECURSIVE common table expression that references itself to traverse hierarchies or graphs, such as org charts or bill-of-materials trees.
B.PIVOT — Operator that rotates distinct values of a column into separate columns, turning long-format rows into a wide cross-tab.
C.PIVOT — The ROWS or RANGE specification defining which rows around the current row a window aggregate sees; RANGE is value-based while ROWS is positional.
D.PIVOT — Operator that rotates columns back into rows, converting a wide cross-tab into long key-value format.
A.Operator that rotates columns back into rows, converting a wide cross-tab into long key-value format.
B.Operator that rotates distinct values of a column into separate columns, turning long-format rows into a wide cross-tab.
C.Join that pairs each left row with rows produced by a lateral subquery depending on that row, often used to expand arrays or call table functions per row.
D.Function returning null when its two arguments are equal, commonly used to guard against divide-by-zero by nulling a zero denominator.
A.UNPIVOT — Operator that rotates columns back into rows, converting a wide cross-tab into long key-value format.
B.UNPIVOT — Function returning null when its two arguments are equal, commonly used to guard against divide-by-zero by nulling a zero denominator.
C.UNPIVOT — A WITH RECURSIVE common table expression that references itself to traverse hierarchies or graphs, such as org charts or bill-of-materials trees.
D.UNPIVOT — SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
A.SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
B.A WITH RECURSIVE common table expression that references itself to traverse hierarchies or graphs, such as org charts or bill-of-materials trees.
C.Function returning null when its two arguments are equal, commonly used to guard against divide-by-zero by nulling a zero denominator.
D.Operator that flattens an array or repeated column into one row per element, the standard way to explode nested data in BigQuery and Snowflake.
23. Which command will A WITH RECURSIVE common table expression that references itself to traverse hierarchies or graphs, such as org charts or bill-of-materials trees.?
A.RECURSIVE CTE — A WITH RECURSIVE common table expression that references itself to traverse hierarchies or graphs, such as org charts or bill-of-materials trees.
B.RECURSIVE CTE — SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
C.RECURSIVE CTE — Function returning null when its two arguments are equal, commonly used to guard against divide-by-zero by nulling a zero denominator.
D.RECURSIVE CTE — Join keyword allowing a subquery on the right side to reference columns from tables on its left, enabling row-by-row correlated joins.
A.Operator that flattens an array or repeated column into one row per element, the standard way to explode nested data in BigQuery and Snowflake.
B.Join that pairs each left row with rows produced by a lateral subquery depending on that row, often used to expand arrays or call table functions per row.
C.A WITH RECURSIVE common table expression that references itself to traverse hierarchies or graphs, such as org charts or bill-of-materials trees.
D.Aggregate clause (FILTER (WHERE ...)) applying a per-aggregate condition, a cleaner alternative to CASE expressions inside aggregates.
26. Which command will Aggregate clause (FILTER (WHERE ...)) applying a per-aggregate condition, a cleaner alternative to CASE expressions inside aggregates.?
A.FILTER — Operator that rotates distinct values of a column into separate columns, turning long-format rows into a wide cross-tab.
B.FILTER — Aggregate clause (FILTER (WHERE ...)) applying a per-aggregate condition, a cleaner alternative to CASE expressions inside aggregates.
C.FILTER — The ROWS or RANGE specification defining which rows around the current row a window aggregate sees; RANGE is value-based while ROWS is positional.
D.FILTER — Function returning the first non-null argument from a list, used to supply defaults and combine fallback columns.
29. Which command will The ROWS or RANGE specification defining which rows around the current row a window aggregate sees; RANGE is value-based while ROWS is positional.?
A.window frame — The ROWS or RANGE specification defining which rows around the current row a window aggregate sees; RANGE is value-based while ROWS is positional.
B.window frame — SQL clause for row-pattern recognition that matches sequences of rows against a regular-expression-like pattern over an ordered partition, used for sessionization and funnels.
C.window frame — Function returning the first non-null argument from a list, used to supply defaults and combine fallback columns.
D.window frame — Operator that flattens an array or repeated column into one row per element, the standard way to explode nested data in BigQuery and Snowflake.
Showing 30 of 78 Advanced SQL questions — the full set, with answers, explanations and an AI tutor on every question, is inside.
Free to start
Answers, AI explanations, and a scored voice mock interview
Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.