Query by Example

devised by Moshé M. Zloof at IBM Research during the mid-1970s

Query by Example (commonly shortened to QBE) is a database query language for relational databases. It was developed at IBM in the 1970s. The development of SQL ran in parallel. QBE was developed for those users who only use databases occasionally, and who do not want to learn a complex language such as SQL.

With Query by example, users are presented with a visual schema of the database, which they edit with a special editor. When they are done, a parser translates their actions into a query in a regular query language such as SQL. Behind the scenes, it is this statement that is actually executed. With a suitable front-end, the user does not need to remember the details of a query language. The user will be able to select tables and columns more quickly, for example by clicking on them, rather than typing their names. This will improve productivity.

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

Today, many database systems have front-ends that resemble QBE.


  • "Query by Example" (pdf; 140 kB). www.cs.wisc.edu. Retrieved 2011-10-15.