Databases Reference
In-Depth Information
6. Access Structured Query Language (SQL)
6.1 Introduction to Access SQL
As we have said, Microsoft Access uses a form of query language referred to as
Structured Query Language , or SQL. (I prefer to pronounce SQL by saying each letter
separately, rather than saying “sequel.” Accordingly, I will write “an SQL statement”
rather than “a SQL statement.”)
SQL is the most common database query language in use today. It is actually more than
just a query language, as I have defined the term in the previous chapter. It is a complete
database management system (DBMS) language, in that it has the capability not only to
manipulate the components of a database, but also to create them in the first place. In
particular, SQL has the following components:
1. A data definition language (DDL)component, to allow the definition (creation) of
database components, such as tables.
2. A data manipulation language (DML) component, to allow manipulation of
database components.
3. A data control language (DCL) component, to provide internal security for a
database.
We will discuss the first two components of SQL in some detail in this chapter.
SQL (also known as SEQUEL) was developed by IBM in San Jose, California. The
current version of SQL is called SQL-92. However, Microsoft Access, like all other
commercial products that support SQL, does not implement the complete SQL-92
standard and in fact adds some additional features of its own to the language. Since this
book uses Microsoft Access, we will discuss the Access version of SQL.
6.2 Access Query Design
In Microsoft Access, queries can be defined in several different ways, but they all come
down to an SQL statement in the end. The Query Wizard helps create a query by asking
the user to respond to a series of questions. This approach is the most user friendly, but
also the least powerful. Access also provides a Query Design window with two different
views. The Design View is shown in Figure 6-1.
Query Design View displays table schemes, along with their relationships, and allows the
user to select columns to return ( projection) and specify criteria for the returned data
( selection ). Figure 6-1 shows a query definition that joins the BOOKS and
PUBLISHERS table and returns the Title, Publisher, and Price of all books whose price is
over $25.00.
 
 
 
Search WWH ::




Custom Search