Family | Query language |
---|---|
Designed by | Michael Stonebraker |
First appeared | 1976 |
Major implementations | |
Ingres, POSTQUEL | |
Influenced by | |
Alpha |
QUEL is a relational database query language, based on tuple relational calculus, with some similarities to SQL. It was created as a part of the Ingres DBMS effort at University of California, Berkeley, based on Codd's earlier suggested but not implemented Data Sub-Language ALPHA. QUEL was used for a short time in most products based on the freely available Ingres source code, most notably in an implementation called POSTQUEL supported by POSTGRES. As Oracle and DB2 gained market share in the early 1980s, most companies then supporting QUEL moved to SQL instead. QUEL continues to be available as a part of the Ingres DBMS, although no QUEL-specific language enhancements have been added for many years.
QUEL statements are always defined by tuple variables, which can be used to limit queries or return result sets. Consider this example, taken from one of the first original Ingres papers:
Example 1.1. Compute salary divided by age-18 for employee Jones.
Here E is a tuple variable which ranges over the EMPLOYEE relation, and all tuples in that relation are found which satisfy the qualification E.Name = “Jones.” The result of the query is a new relation W, which has a single domain COMP that has been calculated for each qualifying tuple.
An equivalent SQL statement is:
QUEL is generally more "normalized" than SQL. Whereas every major SQL command has a format that is at least somewhat different from the others, in QUEL a single syntax is used for all commands.
For instance, here is a sample of a simple session that creates a table, inserts a row into it, and then retrieves and modifies the data inside it and finally deletes the row that was added (assuming that name is a unique field).
Here is a similar set of SQL statements:
Note that syntax varies significantly between commands, and that even similar commands like insert
and update
use different styles.