- QUEL query languages
QUEL is a
relational database access language, similar in most ways toSQL . It was created as a part of the Ingres effort atUniversity of California, Berkeley , based on Codd's earlier suggested but not implementedData Sub-Language ALPHA . QUEL was used for a short time in most products based on the freely-available Ingres source code, most notablyInformix .fact|date=July 2007 As Oracle and DB2 started taking over the market in the early 1980s, most companies then supporting QUEL moved to SQL instead.fact|date=July 2007QUEL statements are always defined by "tuple variables", which can be used to limit queries or return result sets. Consider this example, taken from the original Ingres paper:
range of e is employee retrieve (comp = e.salary/ (e.age - 18)) where e.name = "Jones"
e is a tuple, defining a set of data, in this case all the rows in the employee table that have the first name "Jones". An equivalent SQL statement is:
select (e.salary/ (e.age - 18)) as comp from employee as e where e.name = "Jones"
QUEL is generally more "normalized" than SQL.fact|date=July 2007 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.fact|date=July 2007
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).
create student(name = c10, age = i4, sex = c1, state = c2) range of s is student append to s (name = "philip", age = 17, sex = "m", state = "FL") retrieve (s.all) where s.state = "FL" replace s (age=s.age+1) retrieve (s.all) delete s where s.name="philip"
Here is a similar set of SQL statements:
create table student(name char(10), age int, sex char(1), state char(2)) insert into student (name, age, sex, state) values ("philip", 17, "m", "FL") select * from student where state = "FL" update student set age=age+1 select * from student delete student where name="philip"
Note that every command uses a unique syntax, and that even similar commands like
INSERT
andUPDATE
use completely different styles.Another feature of QUEL was a built-in system for moving records en-masse into and out of the system. Consider this command:
copy student(name=c0, comma=d1, age=c0, comma=d1, sex=c0, comma=d1, address=c0, nl=d1)
into "/student.txt"which creates a comma-delimited file of all the records in the student table. The d1 indicates a delimiter, as opposed to a data type. Changing the
into
to afrom
reverses the process. Similar commands are available in many SQL systems, but usually as external tools, as opposed to being internal to the SQL language. This makes them unavailable to stored procedures.With these differences, however, the two languages are largely the same.fact|date=July 2007
ee also
*
Tutorial D
*D (data language specification)
*D4 (programming language) (an implementation of D)
*Relational algebra
*Relational calculus External links
* [http://www.ils.unc.edu/~dwest/inls258/Non-SQL.html Non SQL Query Languages] , by Antoni Kokot and David West
* C. J. Date: [http://www.cs.duke.edu/~junyang/courses/cps216-2003-spring/papers/date-1983.pdf A Critique of the SQL Database Language] . SIGMOD Record 14(3): 8-54, 1984.
Wikimedia Foundation. 2010.