Other Relational Query Languages

Query-by-Example (QBE)

QBE is a DML whose query language:

The QBE system displays "skeleton tables" - relations with just the attributes (column headers of the tables). The user specifies a query by filling in fields of one or more skeleton tables.

Microsoft Access supports a (very nonstandard) variant of QBE.

Return to Table of Contents

Quel

Quel is the original query language for the Ingres database system. It is based on tuple relational calculus.

Basic form of queries:

range of ttex2html_wrap_inline6 is rtex2html_wrap_inline6
range of ttex2html_wrap_inline10 is rtex2html_wrap_inline10
...
range of ttex2html_wrap_inline14 is rtex2html_wrap_inline14
retrieve (ttex2html_wrap_inline18.Atex2html_wrap_inline20 , ttex2html_wrap_inline22.Atex2html_wrap_inline24 , ..., ttex2html_wrap_inline26.Atex2html_wrap_inline28 )
where P

This is equivalent to the trc query:

tex2html_wrap_inline32 t tex2html_wrap_inline34 ttex2html_wrap_inline36 rtex2html_wrap_inline38 ttex2html_wrap_inline40 rtex2html_wrap_inline42 ttex2html_wrap_inline44 rtex2html_wrap_inline46
P
tex2html_wrap_inline50 t[Atex2html_wrap_inline54 ttex2html_wrap_inline18[Atex2html_wrap_inline58
tex2html_wrap_inline50 t[Atex2html_wrap_inline64 ttex2html_wrap_inline22[Atex2html_wrap_inline68
...
tex2html_wrap_inline50 t[Atex2html_wrap_inline74 ttex2html_wrap_inline26[Atex2html_wrap_inline78

except that the predicate P would be slightly different.

Examples:

Find the name and address of all customers who have purchased a flyrod with flyrod-stock-num of 3.

range of t is customer
range of s is purchased
retrieve (t.name, t.address)
where t.cust-num = s.cust-num and s.flyrod-stock-num = 3

Find the name and address of everyone with the same address as Tim Wahls.

range of t is customer
range of s is customer
retrieve (t.name, t.address)
where s.name = "Tim Wahls" and s.address = t.address

Quel also has aggregate functions: count, sum, avg, max, min, countu, sumu, avgu, any

Function any is related to count - it always returns 0 when count would return 0, and 1 when count would return a number larger than 0.

Example: Find the average length of all flyrods stocked by the flyshop that are not 9 weights.

range of t is flyrod
retrieve avg(t.length where not (t.line-weight = 9))

Return to Table of Contents