encyclopegia.org

Query by Example

Query by Example (QBE) is a database query language for relational databases.

]] Query by Example (QBE) is a database query language for relational databases. ==History== Query by Example was devised by Moshé M. Zloof at IBM Research during the mid-1970s, in parallel to the development of SQL, and influenced by the work on relational databases of Edgar Codd. 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. Originally limited only for the purpose of retrieving data, QBE was later extended to allow other operations, such as inserts, deletes and updates, as well as creation of temporary tables. The motivation behind QBE is that a parser can convert the user's actions into statements expressed in a database manipulation language, such as SQL. Behind the scenes, it is this statement that is actually executed. A suitably comprehensive front-end can minimize the burden on the user to remember the finer details of SQL, it is more productive for end-users (and even programmers) to select tables and columns by selecting them rather than typing in their names. 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 [see search by multiple examples ]. Similarity search is based comparing document vectors (see Vector Space Model). QBE represents 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 ). 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. 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. Contacts Query Form - Example B: .....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. Another approach to text comparisons is to allow one or more wildcard character characters. For example, if an asterisk is designated as a wildcard character in a particular system, then searching for last names using "Rob*" would return (match) last names such as "Rob", "Robert", "Robertson", "Roberto", etc. Contacts Query Form - Example C: .....Name: Rob* ..Address: .....City: ....State: ..Zipcode: Resulting SQL: SELECT * FROM Contacts WHERE Name LIKE 'Rob%' In standard SQL, the percent sign functions like a wildcard in a LIKE clause. In this case, the query-by-examplme form processing software would translate the asterisk to a percent sign. (An asterisk is a more common wildcard convention outside of SQL, so here the form is attempting to be more user friendly.) WARNING: Query-by-example software should be careful to avoid SQL injection. Otherwise, devious users may penetrate further into the database than intended by builders of the query forms.

References

  1. Query-by-Example: A data base language · retrieved 2026-11-18 · rev 1374938188
    Cite this reference

    MLA "Query-by-Example: A data base language." Zloof, M. 2026-11-18. https://en.wikipedia.org/wiki/Doi_(identifier). Accessed 24 November 2026.

    Chicago "Query-by-Example: A data base language." Zloof, M. 2026-11-18. https://en.wikipedia.org/wiki/Doi_(identifier).

    APA Zloof, M. (2026). Query-by-Example: A data base language. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Doi_(identifier)

  2. Search by multiple examples · retrieved 2026-11-18 · rev 1374938188
    Cite this reference

    MLA "Search by multiple examples." Zhu, Mingzhu; Wu, Yi-Fang Brook (2014-02-24). 2026-11-18. https://en.wikipedia.org/wiki/Doi_(identifier). Accessed 24 November 2026.

    Chicago "Search by multiple examples." Zhu, Mingzhu; Wu, Yi-Fang Brook (2014-02-24). 2026-11-18. https://en.wikipedia.org/wiki/Doi_(identifier).

    APA Zhu, Mingzhu; Wu, Yi-Fang Brook (2014-02-24). (2026). Search by multiple examples. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Doi_(identifier)

  3. QBE · retrieved 2026-11-18 · rev 1374938188
    Cite this reference

    MLA "QBE." "QBE", db4o , Developer works Java library, IBM, 27 March 2007 Wikipedia revision 1374938188, retrieved 2026-11-19. 2026-11-18. http://www.ibm.com/developerworks/java/library/j-db4o2.html. Accessed 24 November 2026.

    Chicago "QBE." "QBE", db4o , Developer works Java library, IBM, 27 March 2007 Wikipedia revision 1374938188, retrieved 2026-11-19. 2026-11-18. http://www.ibm.com/developerworks/java/library/j-db4o2.html.

    APA "QBE", db4o , Developer works Java library, IBM, 27 March 2007 Wikipedia revision 1374938188, retrieved 2026-11-19. (2026). QBE. Retrieved November 24, 2026, from http://www.ibm.com/developerworks/java/library/j-db4o2.html

  4. RDBMS Plenary 1: Early Years · retrieved 2025-05-29 · rev 1374938188
    Cite this reference

    MLA "RDBMS Plenary 1: Early Years." "RDBMS Plenary 1: Early Years" (PDF) (Interview). 2025-05-29. https://archive.computerhistory.org/resources/access/text/2013/05/102702562-05-01-acc.pdf. Accessed 24 November 2026.

    Chicago "RDBMS Plenary 1: Early Years." "RDBMS Plenary 1: Early Years" (PDF) (Interview). 2025-05-29. https://archive.computerhistory.org/resources/access/text/2013/05/102702562-05-01-acc.pdf.

    APA "RDBMS Plenary 1: Early Years" (PDF) (Interview). (2025). RDBMS Plenary 1: Early Years. Retrieved November 24, 2026, from https://archive.computerhistory.org/resources/access/text/2013/05/102702562-05-01-acc.pdf

Cite this article

MLA

"Query by Example." encyclopegia.org, 2026, https://encyclopegia.org/wiki/query-by-example. Accessed 24 November 2026.

Chicago

"Query by Example." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/query-by-example.

APA

encyclopegia.org. (2026). Query by Example. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/query-by-example

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1374938188 · 0.5 · snapshot enwiki-001374938188

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.