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 two examples based on a Contacts table with the following text (character) columns: Name, Address, City, State, and Zipcode: Contacts Query Form - Example
A: .....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. 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. == See also ==