HOME

TheInfoList



OR:

Query by Example (QBE) is a
database In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases span ...
query language Query languages, data query languages or database query languages (DQL) are computer languages used to make queries in databases and information systems. A well known example is the Structured Query Language (SQL). Types Broadly, query language ...
for relational databases. It was devised by Moshé M. Zloof at
IBM Research IBM Research is the research and development division for IBM, an American multinational information technology company headquartered in Armonk, New York, with operations in over 170 countries. IBM Research is the largest industrial research org ...
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. 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 Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from Latin ...
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 Information retrieval (IR) in computing and information science is the process of obtaining information system resources that are relevant to an information need from a collection of those resources. Searches can be based on full-text or other co ...
, 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 ee search by multiple examples Similarity search is based comparing document vectors (see
Vector Space Model Vector space model or term vector model is an algebraic model for representing text documents (and any objects, in general) as vectors of identifiers (such as index terms). It is used in information filtering, information retrieval, indexing and r ...
). QBE represents seminal work in
end-user development End-user development (EUD) or end-user programming (EUP) refers to activities and tools that allow end-users – people who are not professional software developers – to program computers. People who are not professional developers can use EUD ...
, 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 Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational Access Database Engine (ACE) with a graphical user interface and software-development tools (not to be confused with the old Microsoft Access w ...
, 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 Tableau (French for 'little table' literally, also used to mean 'picture'; tableaux or, rarely, tableaus) may refer to: Arts * ''Tableau'', a series of four paintings by Piet Mondrian titled ''Tableau I'' through to ''Tableau IV'' * ''Tableau viv ...
, although QBE adds some extensions to that, much like SQL is based on the
relational algebra In database theory, relational algebra is a theory that uses algebraic structures with a well-founded semantics for modeling data, and defining queries on it. The theory was introduced by Edgar F. Codd. The main application of relational algebr ...
.


Example

An example using the
Suppliers and Parts database The Suppliers and Parts database is an example relational database that is referred to extensively in the literature and described in detail in C. J. Date's ''An Introduction to Database Systems'', 8th ed. It is a simple database comprising three t ...
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 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 In software, a wildcard character is a kind of placeholder represented by a single character, such as an asterisk (), which can be interpreted as a number of literal characters or an empty string. It is often used in file searches so the full na ...
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

* CRUD *
Microsoft Query by Example Microsoft Query is a visual 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 using Structured Query Lan ...
*
GraphQL GraphQL is an open-source data query and manipulation language for APIs, and a runtime for fulfilling queries with existing data. GraphQL was developed internally by Facebook (now Meta) in 2012 before being publicly released in 2015. On 7 No ...
a QBE for JSON front-ends. *
QBIC Content-based image retrieval, also known as query by image content ( QBIC) and content-based visual information retrieval (CBVIR), is the application of computer vision techniques to the image retrieval problem, that is, the problem of searching ...


References


Sources

* . * . * . * . * .


External links

* * {{Cite web , url= http://www.ahmetsoylu.com/wp-content/uploads/soylu_UAIS_2016.pdf , format= PDF , title= Experiencing OptiqueVQS: a multi-paradigm and ontology-based visual query system for end users , first1= Ahmet , last1= Soylu , first2= Martin , last2= Giese , first3= Ernesto , last3= Jimenez-Ruiz , first4= Guillermo , last4= Vega-Gorgojo , first5= Ian , last5= Horrocks , date= 2015 , quote= Visual Query System (VQS) , doi= 10.1007/s10209-015-0404-5 Relational model Query languages Human–computer interaction 1970s software IBM software