A Simple Approach to SQL Joins in a Relational Algebraic Notation (original) (raw)

Note on the structure of joins

Information Systems, 1992

When SQL is used to formulate queries for a relational database, many conditions in the WHERE clause appear to be very predictable. These are the so-called join conditions which indicate how the tables of a database are related. It seems that a system should be able to generate these conditions to a great extent automatically from the knowledge of the database structure. To this end the notion of the structure of a join is introduced and mathematically described as a graph morphism. It turns out to be a generalization of the notion of a natural join. It is claimed that this approach is theoretically elegant and provides in practice a good basis for the development of query generators.

Mapping Relational Algebra Operators into SQL Queries: A Database Case Study

2015

Relational algebra operators and mapping to resulting structured query language (SQL) queries are among the most important concepts and skills for students taking a course in database design and implementation, especially those majoring in IS/IT. The most typical relational algebra operators mapped to foundational SQL include unions and intersections, as well as other relational operators applied to these operators, including differences and various joins. Unfortunately, few textbooks or external resources provide ample opportunity for students to apply the full set of most common relational algebra operators mapped to resulting SQL over a single unified case. Most database textbooks exemplify each separate relational algebra construct to a single, sparse (although visually-stimulating) example, wherein the full set of operators is not near fully exemplified. This paper presents an overview of a case example that exemplifies and maps a more complete set of relational algebra operato...

Query processing techniques in the summary-table-by-example database query language

ACM Transactions on Database Systems, 1989

Summary-Table-by-Example (STBE) is a graphical language suitable for statistical database applications. STBE queries have a hierarchical subquery structure and manipulate summary tables and relations with set-valued attributes. The hierarchical arrangement of STBE queries naturally implies a tuple-by-tuple subquery evaluation strategy (similar to the nested loops join implementation technique) which may not be the best query processing strategy. In this paper we discuss the query processing techniques used in STBE. We first convert an STBE query into an “extended” relational algebra (ERA) expression. Two transformations are introduced to remove the hierarchical arrangement of subqueries so that query optimization is possible. To solve the “empty partition” problem of aggregate function evaluation, directional join (one-sided outer-join) is utilized. We give the algebraic properties of the ERA operators to obtain an “improved” ERA expression. Finally we briefly discuss the generation...

A System to Support Teaching and Learning Relational Database Query Languages and Query Processing

The importance of relational algebra in a database course is widely recognized to facilitate teaching and learning of SQL. From our experience we have also found it very useful for the students to understand the basics of query processing in terms of execution plans. However currently there are no specific tools to make the process of learning relational algebra and execution plans an interesting and stimulating activity. The features of the JRS (Java Relational System) graphical editors of query plans are presented. The graphical editors are used to define and execute queries on a database represented by two kinds of trees: A logical plan of relational algebra, and a physical plan that describes an algorithm to execute a query using the physical operators of the relational DBMS developed in Java as a teaching tool.

Relational queries in a domain based DBMS

ACM SIGMOD Record, 1983

This paper addresses the problem of relational queries processing in the domain based database machine DBMAC. A brief description of the storage organisation of the domain based DBMS is first given. Then the operating principles of the domain based data-model, called D-model, is described through some examples. The central part of the paper deals with the translation of relational queries into operations on objects of the D-model. Objects of the D-model and a set of operations on these objects are first defined : this set S of operations is shown to be complete in that any relational query can be translated into D-model operations belonging to S .Finally we give a method for processing relation queries using D-model operations.The basic advantages to be expected from a domain based physical organization of data are :1. fast equi-join execution,2. a compact representation of intermediate results.The latter should lead to efficient processing of complex queries, provided a powerful pa...

Algebraic Query Language (AQL): An Implementation of Relational Algebra

Algebraic Query Language (AQL): An Im, 2025

This white paper presents the Algebraic Query Language (AQL), a database query language developed as an alternative to SQL for data analysis at Caltech's Jet Propulsion Laboratory (JPL). Created by Marc Kidwell Pestana for the GPS Earth Observatory Group, AQL diverges from E. F. Codd's relational model in several key ways; In AQL, data types are assigned to entire relations rather than to individual attributes, and its syntax is algebraic, unlike SQL's quasi-English structure. AQL also includes assignment operators similar to those found in programming languages like C, C++, and Python. Further, it introduces a novel approach to operator type sensitivity and data independence. Despite these differences, AQL retains a strong foundation in Codd's relational model. This paper examines which elements of Codd's model are preserved in AQL and describes the key modifications made. We provide an overview of AQL's core components, along with examples of their usage, and demonstrate how data types are created and assigned to relations in AQL. Additionally, we discuss AQL's development and use at JPL, from early versions to the current, fully operational AQL 5.0. 1 Potential applications of AQL are also explored, including its relevance to Relational Matrices. For further details, a formal definition of AQL is found in Appendix A. Also, [1] and [4] provide an overview of Codd's relational model, [1] and [3] cover Codd's relation, and Appendix B presents the main features of Codd's relational algebra.

Design of an integrated query and manipulation notation for database languages

1992

A common task in data intensive applications is to locate a group of items and then manipulate them, e.g. to give a bonus to all of the employees in a department. Conventional relational query languages like SQL provide facilities for such manipulation-queries, but are not smoothly integrated with a programming language and lack computational power. It has been argued that comprehensions, a construct found in some languages, are a good query notation for database programming languages. An extension to comprehensions is proposed that permits the data to be manipulated by side-effect in addition to being queried. These side-effecting queries are computationally powerful and smoothly integrated into a database programming language, unlike conventional relational query languages. Furthermore side-effecting comprehensions are concise and some may be automatically optimized

The Expressiveness of Query Languages for Nested Relations

The LOTUS Corporation has made a generous donation to partially offset the cost of printing and distributing four issues of the Data Engineering bulletin. Database Engineering Bulletin is a quarterly publication of the IEEE Computer Society Technical Committee on Database Engineering. Its scope of interest includes: data structures and models, access strategies, access control techniques, database architecture, database machines, Intelligent front ends, mass storage for very large databases, distributed database systems and techniques, database software design and implementation, database utilities, database security and related areas. Contribution to the Bulletin is hereby solicited. News items, letters, technical papers, book reviews, meeting previews, summaries, case studies, etc., should be sent to the Editor. All letters to the Editor will be considered for publication unless accompanied by a request to the contrary. Technical papers are unrefereed. Opinions expressed in contributions are those of the Indi vidual author rather than the official position of the IC on Database Engineering, the IEEE Computer Society, or orga nizations with which the author may be affiliated. Membership in the Database Engineering Technical Com mittee Is open to Individuals who demonstrate willingness to actively participate in the various activities of the TC. A member of the IEEE Computer Society may join the TC as a full member. A non-member of the Computer Society may join as a participating member, with approval from at least one officer of the TC. Both full members and participating members of the TC are entitled to receive the quarterly bulletin of the TC free of charge, until further notice. Letter from the TC Chair On behalf of the entire TO on Data Engineering membership, I would like to extend our warmest thanks and appreciation to Sushi! Jajodia for his leadership during the last two years. As the new TC Chair I feel very fortunate in that Sushil will be nearby to offer his advice and counsel. This Fall, Dr. Jajodia will be joining the faculty of George Mason University as Associate Professor of Information Systems and Systems Engineering. Welcome aboard Sushil! In the June issue of the Data Engineering Bulletin, Sushil provided a status report of the major accomplishments of the TO. In brief they are: • Sponsorship and co-sponsorship of conference, symposia and workshops of interest to our members, • The timely and regular publication of the Data Engineering Bulletin, under the stewardship of Won Kim of MOO, and his Associate Editors, with the generous support of our corporate sponsor, the Lotus Development Corporation, and • The active role of our TC in the development of the proposal that helped to establish the new IEEE Transactions on Knowledge and Data Engineering. Our TO is best known for the Data Engineering Bulletin and our association with the Interna tional Conference on Data Engineering. Both provide forums for the publication, presentation, and discussion of research and development results. It is important for our members to be active participants in these forums and future ones. My goals are to continue the good works for which our TO is known, and to explore new avenues of professional development, cooperation and growth. In organizing the International Conferences on Expert Database Systems, I have been fortunate in being able to draw upon the volunteer efforts of dozens of profesionals and several societies in the cooperative effort of forming the organization and program of a large and successful conference. In working with the membership of our TO, I hope to be able to count on your volunteer efforts to help build the TO, and to make it a relevant resource within the IEEE Computer Society. We are asked to provide consultation and opinions on many topics, and I hope to get the membership involved in supporting these activities. In addition, if you have specific suggestions, please feel free to contact me at the address given below. As Sushil mentioned in the June Issue of the Bulletin, the issue of TO membership dues is being addressed by the Society. Dr. Mario Barbacci, Vice Ohair of the Technical Activities Board (TAB), told me that of the 90,000 IEEE Oomputer Society Members only about 3000 are members of a TO. The TO on Data Engineering has 1295 full members and correspondents. Olearly, we have a pool of potential members, and Dr. Barbacci is planning a TO membership drive to be initiated in November with ads and TO descriptions in key IEEE publications. Membership dues will allow our TO to establish a better financial basis to support our activities, such as the publication of the Data Engineering Bulletin. Another method of obtaining funds is through the sponsorship of successful, i.e., money making conferences. Our TO is currently co-sponsoring the Very Large Database Conference and will co-sponsor future Expert Database Systems Conferences. We will also try to complement these funds with contributions from our corporate benefactors. Lastly. Won Kim and I have been concerned about the timely distribution of the Data Engineering Bullc tin. In cider to coordinate this process, I have appointed Mr. David Barber as the liaison for reques~s for back issues, and related matters.

Relational Algebra Interpreter in Context of Query Languages

International Journal of Computer Theory and Engineering, 2011

Relational database systems have succeeded commercially because of their openness and sturdy theoretical groundwork. The contribution of this title "Relational Algebra Interpreter in context of query languages" is presentation of new implementation in such a way so that queries written in relational algebra can be compiled into SQL and executed on a relational database system. It takes a relational algebra statement as key, does syntactic and lexical parsing on it. In the event of an error in the syntax of the expression it will forward the error to user. If the syntax is correct the relational algebra expression is converted into a SQL statement and executed on an RDBMS. This work can serve up as a basis learning Relational Algebra for different class of users, as they will be given immediate feedbacks about their queries.