Jump to content

Query by Example

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 194.81.79.16 (talk) at 13:34, 27 October 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

shaf is well kewl In the context of information retrieval, QBE has a somewhat different meaning. The user can submit a document, or several documents, and ask for "similar" documents to be retrieved from a document database. Similarity search is based comparing document vectors (see Vector Space Model).

QBE is a seminal work in end-user development, frequently cited in research papers as an early example of this topic.

Currently, QBE is supported in several relational database front ends, notably Microsoft Access, which implements "Visual Query by Example", as well as Microsoft SQL Server Enterprise Manager. It is also implemented in several object-oriented databases (e.g. in db4o[1]).

QBE is based on the logical formalism called tableau query, although QBE adds some extensions to that, much like SQL is based on the relational algebra.

Example

An example using the Suppliers and Parts database is given here to illustrate how QBE works. File:QBESampleTable2.jpg

As a general technique

The term also refers to a general technique influenced by Zloof's work whereby only items with search values are used to "filter" the results. It provides a way for a software user to perform queries without having to know a query language (such as SQL). The software can automatically generate the queries for the user (usually behind the scenes). Here are some examples:

Example Form B:

.....Name: Bob
..Address:
.....City:
....State: TX
..Zipcode:

Resulting SQL:

SELECT * FROM Contacts WHERE Name='Bob' AND State='TX'

Note how blank items do not generate SQL terms. Since "Address" is blank, there is no clause generated for it.

Example Form C:

.....Name: 
..Address:
.....City: Sampleton
....State: 
..Zipcode: 12345

Resulting SQL:

SELECT * FROM Contacts WHERE City='Sampleton' AND Zipcode='12345'

More advanced versions of QBE have other comparison operator options, often via a pull-down menu, such as "Contains", "Not Contains", "Starts With", "Greater-Than", and so forth.

See also

References

  1. ^ "QBE", db4o, Developer works Java library, IBM

Sources