Monday, November 14, 2011

Databases

In order to work successfully with databases, one needs to understand how they are organized. This blog post is designed to provide a working knowledge of database organization and to introduce basic terminology you will need for mastering Access.

Reminder:
You can click on any screenshot image to spawn a new window with an enlarged image for easier reading.

Relational databases are very powerful tools used for storing and manipulating information. The basic unit of a database is the table; a database can have one to many tables. At first, you might wonder why bother with learning about databases at all since a table looks an awful lot like an Excel spreadsheet.

Inventory value table in bookstore database

Each row in the table is called a record. Each record consists of some number of fields. Unlike in a spreadsheet where all of the columns are labeled alphabetically, in a database, the database's designer chooses descriptive field names.

For example, when we worked on the marching band roster, we had to use one row of the spreadsheet for column headers. Column A was "Last Name". We could not change the name of the column. In the screenshot above, we can see that the first field is named "Author's Last Name".

Moving around a table in the table is easy. There are buttons for moving the cursor (insertion point) to the first, previous, next, and last records in the table. It also shows which button will move the insertion point to allow you to enter new data (a new record).

If a database was merely a collection of tables, we wouldn't bother with creating them. We already have that level of functionality in a spreadsheet. What makes a database so powerful is that we can query it. In other words, we can ask it questions.

Take as an example the table above. Suppose I only wanted to view the authors associated with the publishing company "Knopf". I can simply ask the database for that information.

You've got questions?
Access has answers!

We saw some similar behavior when we converted spreadsheets into tables but a database is more powerful and more efficient for large quantities of data. We can save multiple queries in the database and execute each one on an as-needed basis. We can also design and print reports right from the database.

Reports can be sorted and filtered, too