Database Reference
In-Depth Information
Queries on ORDER relation
Print all order numbers for Customer “Robert Smith”
OrdrNo
OrdrDate
OrdrAmt
CustName
P.
Robert Smith
Find the order numbers and order dates of all orders with amounts more than $750
OrdrNo
OrdrDate
OrdrAmt
CustName
P.
P.
>
750
Find the order numbers and order amounts of all orders not for “Bill Jones”
OrdrNo
OrdrDate
OrdrAmt
CustName
P.
P.
NOT Bill Jones
Figure 13-6
QBE queries.
Query-by-Example Query-by-example (QBE) adopts a visual approach to
implementing the data model through templates. You enter an example value into
the template for data retrieval. Queries are expressed as examples that are provided
through the language.
QBE was developed in early 1970s at IBM's Watson Research Center. Later, the
QBE data manipulation language component was used in IBM's Query Manage-
ment Facility (QMF). Today, many relational DBMSs including Microsoft ACCESS
and IBM's Paradox use QBE in one form or another.
In QBE, you use a skeletal two-dimensional table to express your query.
Queries are in the form of tables, not free-form text with statements or com-
mands. You fill in a skeletal table with example rows. An example row consists of
example data elements and constants. The result of the query is also presented as a
table.
Figure 13-6 shows examples of QBE queries.
QBE has provisions to perform the following:
Indicate conditions for data retrieval through the use of condition boxes
Display results taking values from several database relations
Order the display of result rows
Perform aggregations
Data maintenance—deletion, insertion, and update
Quel Developed at the University of California, Berkeley, Quel was introduced
as the implementation language for the Ingres database system. Three basic types
of clauses exist: range of, retrieve, and where. The underlying structure resembles
that of relational calculus.
You can express most of the queries just by using these three standard clauses.
The first clause, “range of” declares a tuple or row variable taking on values of tuples
Search WWH ::




Custom Search