Introduction
There are various parts to a database that we should know about. These include tables, forms, queries, reports, macros and modules.

Tables
The first component we should know about in a database is a table. Here is an example of a table of data about zoo animals.

A database is made up of one or more tables. Each table (also known as a 'file') holds the records for just one entity and an entity is an actual, real-life thing about which we want to keep information. We saw here that tables are made up of records in table rows, fields (attributes) in columns, actual data items and a key field also known as a primary key
Forms
The next database component we should be able to identify is a form.
A form is used to enter new records into a database, one record at a time. They are also used to navigate through existing records and to edit them. Forms have some common characteristics. These include
- a title (because you may have more than one form)
- field names (so you know what piece of data needs to be entered
- place holders, so you know where to type in data
- navigation buttons, so you can move through the different forms easily
- form operations such as 'close', so that you can easily and quickly carry out common operations
- data entry validation rules, so that you can help prevent erroneous data from being entered into the system
- different methods of data entry such as tick boxes, so that you can speed up data entry and reduce spelling errors.
Queries
The third component of a database is the query. This is used to search through the data we have in our tables to answer questions or queries such as:
- Could I have a list of all the elephants
- Could I have a list of all the animals born before 3rd July 2006
- 'Could I have a list of all the animals looked after by the keeper called Mr Cooper.
We design the query first and then we run it. Designing a query can be done in a number of ways, including using a language called Structured Query Language (SQL). This is common to most database applications software. Below, we haven't used SQL but an alternative known as Query By Example (QBE) which is available for use in Access.

When we run this query, we get the results presented as a table:
Reports
Queries only give us results presented as a table of results. If we want to lay them out so they look professional, with added information such as a logo, a title for the report, headings for the columns of data, a date and so on, and also if we want to organise how the information is presented, perhaps by grouping the results in some way, then we need to use reports. Reports are the next main component we should know about in a database.
Macros
The next component of a database we should know about is the macro. Macros provide extra features and functionality to a database, over and above what can be achieved by using just the tools that come with your database application. A macro is a sequence of instructions which we give a single name to. For example, we have created a macro called 'autoexec' in the following screendump:
The name of this particular macro is 'autoexec' and the sequence of instructions it performs are:
- Maximise the viewing window
- Open the data input form
- Beep, so the user knows that they can begin.
We can now run this macro at anytime by simply calling it from within our program. In Access, the simplest way to do this is to go a Form, then go into Design view, click and drag a button onto the form (making sure that the wizards pop up automatically) and then select Miscellaneous and Run macro.
Having said that, there is one macro that is special. If you name a macro 'autoexec' then that macro is run automatically when you first open any Access database. Access always looks for a macro called 'autoexec' when it opens. If it doesn't find one, it just opens up the database as normal. If does find one, however, then it runs all of the instructions it finds in the macro.
Modules
The last component we shall consider is the 'module'. Like macros, modules provide extra features and functionality to a database, over and above what can be achieved by using just the tools that come with your database application. Programmers can write modules in a programming language and then run them when they are needed from the database.

Q1. Summarise the main components of a database.
Q2. Describe what a data input form is used for.
Q3. What are the key differences between the results of a query and a report?
Q4. What key things should always go on a report and why?
Q5. What is a ‘macro’?
Q6. What is a ‘module’?
|