Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Example  





2 As a general technique  





3 See also  





4 References  





5 Sources  





6 External links  














Query by Example






Català
Deutsch
Español
Euskara
Français

Italiano

Polski
Português
Русский
Simple English
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

(Redirected from Query By Example)

Example of QBE query with joins, designed in Borland's Paradox database

Query by Example (QBE) is a database query language for relational databases. It was devised by Moshé M. ZloofatIBM Research during the mid-1970s, in parallel to the development of SQL.[1] 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, and it is easier and 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[2]]. 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[3]).

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[edit]

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

Simple QBE example
S S# SNAME OWNER SCITY
P.SX J. DOE ROME

As a general technique[edit]

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. For 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.

Another approach to text comparisons is to allow one or more wildcard character characters. For example, if an asterisk is designated as a wild 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.

See also[edit]

References[edit]

  1. ^ Zloof, M.M. (1977). "Query-by-Example: A data base language". IBM Systems Journal. 16 (4): 324–343. CiteSeerX 10.1.1.86.3485. doi:10.1147/sj.164.0324.
  • ^ Zhu, Mingzhu; Wu, Yi-Fang Brook (2014-02-24). "Search by multiple examples". Proceedings of the 7th ACM international conference on Web search and data mining. ACM. pp. 667–672. doi:10.1145/2556195.2556206. ISBN 9781450323512. S2CID 8397529.
  • ^ "QBE", db4o, Developer works Java library, IBM, 27 March 2007
  • Sources[edit]

    • Zloof, Moshé M. (May 1975), "Query by Example", National Computer Conference, AFIPS Conference Proceedings, vol. 44, Anaheim, California: AFIPS Press, pp. 431–8, ISSN 0095-6880.
  • Ramakrishnan, Raghu; Gehrke, Johannes, "6. QBE" (PDF), Database Management Systems (3rd ed.), Wisc.
  • Date, Christopher ‘Chris’ J. (2004), "8. Relational Calculus", An Introduction to Database Systems, Addison-Wesley Pearson, pp. 242–7, ISBN 978-0-321-18956-1.
  • Oracle Definitions, Tech target.
  • Zaiane, O. (1998), "5. Query-by-Example (QBE)", CC 354 notes, Canada: SFI.
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Query_by_Example&oldid=1217906006"

    Categories: 
    Relational model
    Query languages
    Humancomputer interaction
    1970s software
    IBM software
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
     



    This page was last edited on 8 April 2024, at 15:33 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki