sql
Applied AI interview questions tagged sql, across every topic.
39 questions · 3 unlocked for you
Concepts behind "sql"
The curriculum that explains the ideas these questions test.
Foundational
Window FunctionsWindow functions compute across a set of rows related to the current row, without collapsing them like GROUP BY does, so you can rank within groups, compute running totals and moving averages, and compare a row to its neighbors (LAG/LEAD), all in one pass. They are the backbone of analytics SQL: top-N-per-group, sessionization, cohort analysis, and period-over-period. Applied-AI interviews probe them because they are the single most-tested SQL skill and the cleanest way to express analytical queries.🗄️ Data & SQL Engineering
Foundational
Data Quality and ContractsModels and analytics are only as good as their data, and a silent upstream data change (a renamed column, a units switch, a spike in nulls) corrupts everything downstream with no error. Data quality means automated checks (schema, ranges, nulls, freshness, volume, uniqueness) plus data contracts between producers and consumers enforced in CI. Applied-AI interviews probe it because 'garbage in, garbage out' is the most common, hardest-to-diagnose cause of model and dashboard failures.🗄️ Data & SQL Engineering
Foundational
SQL JoinsJoins combine rows across tables on a matching condition, and the join type (inner, left, right, full, semi, anti) controls which non-matching rows survive. Applied AI interviews probe joins because they are the single most error-prone SQL construct: the wrong type silently drops or duplicates rows, and a non-unique join key fans out your row count without raising an error.🗄️ Data & SQL Engineering
Foundational
GROUP BY and AggregationGROUP BY collapses rows sharing the same key values into one row per group, and aggregate functions (COUNT, SUM, AVG) compute a single value per group. Applied AI interviews probe it because the semantics trip people up: a column must be either grouped or aggregated, COUNT silently ignores NULLs, and HAVING filters groups while WHERE filters rows. Conditional aggregation with SUM of CASE is the move that pivots data without a join.🗄️ Data & SQL Engineering
Foundational
CTEs and SubqueriesA CTE (the WITH clause) names an intermediate result so a query reads as a top-to-bottom pipeline instead of nested subqueries. The skill is knowing when a subquery should be correlated versus uncorrelated, when a recursive CTE is the right tool for hierarchies and graphs, and when a CTE acts as an optimization fence that blocks the planner. Applied-AI interviews probe it because refactoring a tangled nested query into a readable, correct pipeline is a daily data-engineering task.🗄️ Data & SQL Engineering
Core
Transactions, ACID, and Isolation LevelsA transaction groups several reads and writes so they either all commit or all roll back, with the ACID guarantees of atomicity, consistency, isolation, and durability. Isolation level is the dial that trades concurrency anomalies (dirty reads, non-repeatable reads, phantoms) against throughput, and most databases default to a weaker level than engineers assume. Applied AI and data interviews probe it because pipelines that ignore isolation produce silent, intermittent corruption that no unit test catches.🗄️ Data & SQL EngineeringSign in
