Query by Example (QBE) & Structured Query Language (SQL)

Query by Example (QBE) and Structured Query Language (SQL) are industry standard languages for querying data to obtain information from relational database systems.

Query by Example (QBE) was developed in tandem with SQL in the 1970s by IBM (Zloohf) where the technique of using search terms was used to filter data based on data content graphically. This avoided the user having to know or learn SQL or any other query language as QBE itself included the language necessary to perform the searches in order to achieve results quickly on built-in logical conditions. Microsoft QBE, as used by Microsoft Access, is largely used to obtain results from search queries however the QBE language can be used for the creation or modification of data.

QBE and SQL are largely interchangeable. Performing a sample query in Microsoft Access using QBE and using its graphical tools to establish the query parameters gives a graphical representation of the query and on viewing the SQL within the program the user is presented with an accurately written piece of equivalent SQL code that performs an identical query.

The advantage versus disadvantage discussion of QBE and SQL is largely dependent on the technical skills (and background) of the user and the time available to develop the query in question. It must be remembered that Microsoft Access has the largest database user base in the world for an extremely good reason; it is graphical and easy to use. Microsoft QBE is therefore exactly the same yet it can become the technical procedure that some may prefer if the user has the technical preference to develop their own SQL queries. The Microsoft QBE language however is an interpretation of QBE as standards were never developed to ensure conformity across systems. This can lead to such interpretations as Microsoft QBE differing from graphical based product to product and hence there is a risk of different results being obtained from seemingly identical queries in a limited number of cases. As SQL has written and constantly developing standards and is ubiquitous in the relational database industry then the technical ability to write code based SQL queries ensures that queries, if properly written according to those standards, will yield the same results across products and systems and therefore we can place reliance on its integrity. Whilst Microsoft Access QBE is largely sufficient for the target market it serves (small standalone single-user databases), the QBE lack of portability makes SQL much more advantageous in my opinion.

References

Coronel, Morris & Rob (2009) Database Systems: Design, Implementation, and Management (9th Edition). Cengage Learning.

Databasedev (n.d.) MS Access versus SQL Server [Online] Available at http://www.databasedev.co.uk/ms-access-vs-sql-server.html (Accessed 18 April 2010)