Why Use SQL?

As you look through the syntax of the SQL statements in this chapter, you may be struck by the fact that SQL is not a particularly pleasant language. Moreover, as we have said, many features of SQL can be accessed through the Access Query Design Window. So why program in SQL at all?

Here are some reasons:

  • There are some important features of SQL that cannot be reached through the Query Design Window. For instance, there is no way to create a union query, a subquery, or an SQL pass-through query (which is a query that passes through Access to an external database server, such as Microsoft SQL Server) using the Query Design Window.

  • You cannot use the DDL component of SQL from within the Query Design Window. To use this component, you must write SQL statements directly.

  • SQL can be used from within other applications, such as Microsoft Excel, Word, and Visual Basic, to run the Access SQL engine.

  • SQL is an industry standard language for querying databases, and as such is useful outside of the Microsoft Access environment.

Despite these important reasons, we suggest that, on first reading, you go lightly over the SQL commands, to get a flavor for how they work. Then you can use this chapter as a reference whenever you need to actually write SQL statements yourself. Fortunately, SQL has relatively few actual commands, which makes it easy to get an overall picture of the language. (For instance, SQL is single-statement oriented. It does not have control structures such as For... ...

Get Access Database Design and Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.