Complex Quantification in Structured Query Language (SQL): A Tutorial Using Relational Calculus
Jalal Kawash, American University of Sharjah
JCMST Volume 23, Number 2, ISSN 0731-9258 Publisher: Association for the Advancement of Computing in Education (AACE), Waynesville, NC USA
The Structured Query Language (SQL) forms a substantial component of introductory database courses and is supported by almost every commercial database product. One disadvantage of SQL is that it does not provide a universal quantification construct. Queries that have twisted universal and existential quantifiers can be stunning for students, practitioners, or even instructors. Universal quantification exists in natural languages and proliferates in our daily logic. Experience shows that students can infer the rigorous logic, such as the tuple relational calculus, from natural language queries, but find it cumbersome to translate it to SQL. To bridge this gap, this article develops a systematic method to translate tuple relational calculus queries to SQL. This is accomplished by introducing the SQL-Normal-From of tuple relational calculus from which generating SQL code is straightforward. The approach is illustrated by a series of examples. This method was voluntarily adopted by a vast majority of students when it was introduced in a third-year introductory course on database systems.
Kawash, J. (2004). Complex Quantification in Structured Query Language (SQL): A Tutorial Using Relational Calculus. Journal of Computers in Mathematics and Science Teaching, 23(2), 169-190. Norfolk, VA: Association for the Advancement of Computing in Education (AACE).
© 2004 Association for the Advancement of Computing in Education (AACE)