Query by Example

Query by Example

Query by Example (QBE) is a database query language for relational databases. It was devised by Moshè M. Zloof at IBM Research during the mid 1970s, in parallel to the development of SQL. It is the first graphical query language, using visual tables where the user would enter commands, example elements and conditions. Many graphical front-ends for databases use the ideas from QBE today.

Based on the notion of Domain relational calculus, QBE can be used as a search tool as well. A QBE parser parses the search query and looks for the keywords while eliminating words like "a", "an" or "the". A more formal query string, in languages such as SQL, is then generated, which is finally executed. However, when compared with a formal query, the results in the QBE system will be more variable. The user can also search for similar documents based on the text of a full document that he or she may have. This is accomplished by the user’s submission of documents (or numerous documents) to the QBE results template. The analysis of these document(s) the user has inputted via the QBE parser will generate the required query.

Example

A simple example using the Suppliers and Parts database is given here to illustrate how QBE works.

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 peform 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 Query-by-Example have other comparison operator options, often via a pull-down menu, such as "Contains", "Starts With", "Greater-Than", and so forth.

See also

*Microsoft Query by Example

References

* M. Zloof. "Query by Example". AFIPS, 44, 1975.
* Raghu Ramakrishnan, Johannes Gehrke. "Database Management Systems" 3rd edition. [http://www.cs.wisc.edu/~dbbook/openAccess/thirdEdition/qbe.pdf Chapter 6] .
*cite book | first=C.J. | last=Date | year=2004 | title=An Introduction to Database Systems | chapter=8 Relational Calculus | publisher=Pearson Education Inc. | editor=Maite Suarez-Rivas; Katherine Harutunian | id=ISBN 0-321-18956-6

Sources

* Oracle Definitions: http://searchoracle.techtarget.com/sDefinition/0,,sid41_gci214554,00.html
* http://www.cs.sfu.ca/CC/354/zaiane/material/notes/Chapter5/node2.html
* http://www.cs.wisc.edu/~dbbook/openAccess/thirdEdition/qbe.pdf

External links

* [http://pgfoundry.org/projects/qbe Query by Example for PostgreSQL]
* [http://www.hibernate.org/hib_docs/reference/en/html/querycriteria.html#querycriteria-examples Query by Example in Java using Hibernate]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Query by Example — (Suche anhand von Beispielen) bezeichnet eine relationale Datenbankabfragesprache, die von Moshé M. Zloof bei IBM parallel zu System R entwickelt wurde. Sie beruht im Wesentlichen auf dem Bereichskalkül. Dabei wird die Abfrage nicht wie in SQL… …   Deutsch Wikipedia

  • Query by Example — Query by Example,   QBE …   Universal-Lexikon

  • Query By Example — L interface QBE de Kexi Query By Example (abr. QBE, en français interrogation par l exemple), est un type d interface utilisateur servant à effectuer des recherches dans des bases de données relationnelles. Le principe d une interface QBE est que …   Wikipédia en Français

  • Query By Example —    (QBE)    A data base front end that requests the user to supply an example of the type of data to be retrieved …   IT glossary of terms, acronyms and abbreviations

  • Microsoft Query by Example — (QBE) is a method of creating database queries using examples based on a text string, the name of a document or a list of documents. The QBE system converts the user input into a formal database query. This approach allows the user to perform… …   Wikipedia

  • Query by humming — (QbH) is a music retrieval system that branches off the original classification systems of title, artist, composer, and genre. It normally applies to songs or other music with a distinct single theme or melody. The system involves taking a user… …   Wikipedia

  • query language — ▪ computer science       a computer programming language used to retrieve information from a database.       The uses of databases are manifold. They provide a means of retrieving records or parts of records and performing various calculations… …   Universalium

  • Example — Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom. Pour les articles homonymes, voir Exemple. Example est un rappeur britannique. .example est un domaine de premier niveau réservé. Example.com …   Wikipédia en Français

  • Query optimization — is a function of many relational database management systems in which multiple query plans for satisfying a query are examined and a good query plan is identified. This may or not be the absolute best strategy because there are many ways of doing …   Wikipedia

  • Query flooding — is a method to search for a resource on a P2P network. It is simple but scales very poorly and thus is rarely used. Early versions of the Gnutella protocol operated by query flooding; newer versions use more efficient search algorithms.OperationA …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”