Query by Example

Query by Example ( QBE; . Engl, search using examples ') is a relational database query language that was developed by Moshé M. Zloof at IBM parallel to the R. It was based essentially on the area calculation. The query (query ) is not represented as in SQL by a text, but by a table framework that can be edited using special editors. This graphical query language is specifically aimed at casual users who can start with SQL and other complex queries little.

Use

QBE -like interfaces can still be found as a graphical front ends for database systems.

The QBE interface can be found, for example, as one of several query functions in the DOS database programs dBASE IV and V, which were 1988-1995 rampant realized.

QBE is relationally complete, however, for some queries a series of QBE queries needed, so it is not strictly relationally complete.

When searching in search engines is meant by Query by Example search for documents which have a minimum match for a selected sample document.

Principle

The system first sets table stand ( also: skeleton ) are available that can be filled by the user with sample elements, comparison operations and commands. For more complex conditions, there is a special table, the condition box. Furthermore, aggregate functions can be used. Lines can be negated altogether.

Example elements start with "_", and are used to join tables ( join) and the identification of the conditions in the condition box. Comparison operations are specified in a cell, for example, the attribute compares the entry " > 7" accordingly. The commands are P., I. and D. and are available for print, insert and delete. I. and D. are always specified in the first column, Fr can be in the first column to output the entire line, or at one or more attributes to output only those attributes - but a negated line must not contain P..

Examples

In the system, these relations are available:

In QBE then it sends requests by filling the table stands.

From these examples you can see how the projection ( hide columns ) and selection (hiding rows) to be implemented. Two requests, use the links, and use example elements:

The next example shows the use of negated lines:

The cross product of two relations one would form as follows:

For the implementation of the set operations of the relational algebra more instructions are needed. Had two relations with the CUSTOMER schema CUSTOMER and CHEATERS, you could get all sorts AUTHORITY by a union of the two relations. This is only possible with two operations, not one:

There the values ​​of the CUSTOMER relation be inserted into a new relationship first. Then, in a second operation, the CHEATERS come to this:

The new relation now contains CUSTOMER ∪ CHEATERS.

666263
de