Table of Contents
Fetching ...

Relational Playground: Teaching the Duality of Relational Algebra and SQL

Michael Mior

TL;DR

Relational Playground addresses the gap between learning SQL syntax and understanding the relational algebra and optimization behind query processing. It provides an in-browser tool that automatically maps SQL queries to relational algebra, visualizes intermediate results, and demonstrates a simple, heuristic query optimization (predicate pushdown). Initial student feedback suggests the approach improves understanding of relational algebra, and the paper discusses design choices, comparisons to related tools, and plans for broader SQL coverage and evaluation. Together, these contributions offer a practical, hands-on method for teaching database query processing and optimization that can scale to larger curricula and diverse data models.

Abstract

Students in introductory data management courses are often taught how to write queries in SQL. This is a useful and practical skill, but it gives limited insight into how queries are processed by relational database engines. In contrast, relational algebra is a commonly used internal representation of queries by database engines, but can be challenging for students to grasp. We developed a tool we call Relational Playground for database students to explore the connection between relational algebra and SQL.

Relational Playground: Teaching the Duality of Relational Algebra and SQL

TL;DR

Relational Playground addresses the gap between learning SQL syntax and understanding the relational algebra and optimization behind query processing. It provides an in-browser tool that automatically maps SQL queries to relational algebra, visualizes intermediate results, and demonstrates a simple, heuristic query optimization (predicate pushdown). Initial student feedback suggests the approach improves understanding of relational algebra, and the paper discusses design choices, comparisons to related tools, and plans for broader SQL coverage and evaluation. Together, these contributions offer a practical, hands-on method for teaching database query processing and optimization that can scale to larger curricula and diverse data models.

Abstract

Students in introductory data management courses are often taught how to write queries in SQL. This is a useful and practical skill, but it gives limited insight into how queries are processed by relational database engines. In contrast, relational algebra is a commonly used internal representation of queries by database engines, but can be challenging for students to grasp. We developed a tool we call Relational Playground for database students to explore the connection between relational algebra and SQL.
Paper Structure (7 sections, 3 figures)

This paper contains 7 sections, 3 figures.

Figures (3)

  • Figure 1: Screenshot of the Relational Playground interface
  • Figure 2: Post-optimization view in Relational Playground
  • Figure 3: Tree view of optimized relational algebra expression