UPDF AI

Teaching SQL with Simplicity: A Shift from Relational Algebra to Canonical Databases

N. Preda,Louis Jachiet

2025 · DOI: 10.1145/3735091.3737570
0 Citations

TLDR

This work proposes shifting the focus to canonical databases and functional dependencies, enabling students to develop an intuitive understanding of cardinalities, GROUP BY queries, and SQL’s expressive limitations, while remaining rigorous and formally grounded.

Abstract

Traditional SQL teaching often begins with relational algebra, reinforcing an imperative mindset that does not align with SQL’s declarative nature. This approach encourages students to think in terms of algebraic operations rather than reasoning about data and constraints, leading to solutions that rely on nested queries and procedural breakdowns where they are unnecessary. We propose shifting the focus to canonical databases and functional dependencies (FDs), enabling students to develop an intuitive understanding of cardinalities, GROUP BY queries, and SQL’s expressive limitations. FDs, often confined to data modeling, are fundamental in query formulation: they dictate which attributes can be grouped safely and reveal structural properties that support the handling of queries involving negation or universal quantification, highlighting when a query must be rewritten as a difference of subqueries. Our approach provides a more intuitive alternative to relational calculus, making SQL semantics accessible even to students with less mathematical background, while remaining rigorous and formally grounded.