Queries in Access


Queries in Access.  I will write just a bit about queries in Access.

The book focuses on using SQL for queries.  Ultimately, you want to be able to construct queries in SQL as a fairly universal standard.  You may not know this, but SQL was designed to be the common ground between a large number of different DBMS.  Developers were clamoring that they could not get their knowledge of one system to transfer to another very well.  They were also very concerned about getting different DBMS to communicate and work across DBMS.  This shouldn't be very surprising to anyone.

But SQL will generally be considered more difficult by almost everyone.  My intent is to use this course to get you more used to things like queries and reports in Access so that you can then learn SQL more easily and have more context about where your studies in SQL will lead.

Queries in Access have been developed in a style called QBE - Queries by Example, by most.  Rather than get into an abstract discussion I think you will learn more by seeing a large variety of examples.  But still, there are reasons to use QBE.

After you have learned to construct Access queries using QBE you can get Access to convert them into SQL.  The truth is, I am much more familiar with SQL than QBE.  Though, QBE has been around at least since the early 1990s when I first used it.  The versions I first learned were developed to work well with the Windows interface.  Access was not really developed until later.

But some of the advantages of QBE and the interface are

  • you can use relationships diagrams constructed with the tables to help you write the queries
    • this definitely helps quite a bit with some of the more complicated queries that rely on these relationships - SQL requires the developer to be much more explicit about these relationships - whereas QBE builds from the diagrams
  • you can select particular fields and drag and drop them into appropriate places
  • you can fill in boxes and click things to get things done like
    • sorts
    • displays
  • you do not need to be anywhere near as concerned about syntax and spelling and so on, since the QBE interface requires considerably less typing and spelling

So now we will go back through some of the examples we've worked on previously.  I will try to make use of images and step by step descriptions to lead you through the steps.