DATABASES
DATABASES
1 DATABASES
Specific Objectives:
By the end of the sub- module unit, the trainer should be able to:
Definition of a database
Referential integrity
Are rules the ensure that relationships between coupled tables remain consistent
Relationships
Before you come up with a database several considerations need to be taken into account so that
one can develop a good database.
What is good database design?
Certain principles guide the database design process. The first principle is that duplicate
information (also called redundant data) is bad, because it wastes space and increases the
likelihood of errors and inconsistencies. The second principle is that the correctness and
completeness of information is important. If your database contains incorrect information, any
reports that pull information from the database will also contain incorrect information. As a
result, any decisions you make that are based on those reports will then be misinformed.
Provides Access with the information it requires to join the information in the tables
together as needed.
Helps support and ensure the accuracy and integrity of your information.
A database is a collection of information that is related. Access allows you to manage your
information in one database file. Within Access there are four major objects: Tables, Queries,
Forms and Reports.
Tables – store data in rows and columns. In a table, each row is a record, and each record
consists of one or more fields
Queries – extract subsets of data from one or more tables, allowing you to view exactly the data
you want
Macros – add functionality to database objects and are often used to automate certain database
tasks
Modules – also add functionality to a database, and are stored collections of Visual Basic for
Applications (VBA) programming language statements and procedures
5.2.0 Entering Data in a Table
1. In Datasheet View, start typing the data into the table by pressing the tab key to move to
the next cell
2. When you have completed the record (row), press Enter
3. You can also click on the New record icon on the Home tab in the Records group or at the
bottom of the table
Navigating in a Table
Use the arrows at the bottom of the table to navigate among records.
Steps:
Design menu
Insert rows
To delete a row:
Steps:
Open the table in design view (Using the above dialog box),
Design menu
Delete rows
Home menu
More
Ok
1. Start Access
2. Click on Blank desktop database
3. Under File Name type a name for the database
4. To change the location of where to store the database, click the folder icon and select a
location
5. Click Create
Access opens in a new table in Datasheet View.
Creating a Table
A table is a collection of data about a specific topic, such as employee information, products or
customers. The first step in creating a table is entering the fields and data types. This can be done
in either Datasheet View or Design View but it is recommended to set up the table in Design
View
Understanding Views
There are multiple ways to view a database object. The two views for tables are Design View
and
Datasheet View.
Design View is used to set the data types, insert or delete fields, and set the Primary Key
Datasheet View is used to enter and view the data for the records
Switching Between Design View and Datasheet View:
Click the View arrow on the Home tab and click on either Datasheet View or Design View
A query is an object that is used to extract records that fulfil a specified question or criteria. It is
also used to do calculations.
It is the most common type of query. It retrieves data from one or more tables and display the
results in a datasheet where you can update the records (with some restrictions). You can also
use a select query to group records and do calculations.
Are used to calculate and restructure data for easier analysis of data.
An action query is a query that makes changes to or moves many records in just one operation.
a) Delete query: this deletes a group of records from one or more tables
d) Make-table queries: creates a new query from all or part of the data in the table.
i) Query Design
Creates a new blank query in design view. You can use show table dialog box to add tables or
queries.
As with any wizard, the query wizard will prompt user with step by step process, supply fields
from tables and any information necessary until the query is created.
The table(s) will now be displayed in the upper part of the Query Design Screen by boxes
containing the tables’ fields.
7. Double-click on the field names in the field list window which you would like to include in
the query
i) Direct method:
Here all the fields in a given table are used to create the form. It is a very rigid method of
creating a form.
Steps:
Open the table or query on which you are basing the form
Click on the Create tab
Click on Form in the Forms group
A form is created and opens in Layout View.
It allows the user to select fields from different tables. It solves the problem of rigid in direct
method. The tables must have a relationship.
Steps:
Create menu
Blank Form
This is creating a form from scratch where you enter new fields. It is not based on any table. It is
the most flexible way of creating a form.
Steps:
Create menu
Form design
Limitation: you can only print the form direct, you cannot store data.
iv) Form Wizard:
Steps:
Create menu
Form wizard
Select table/query
Select fields
Finish.
Advantage: it can be used to construct a form having fields from different tables.
Different Views:
Form View – this view allows you to view, create and edit records
Layout View - this view is similar to Design View but is more visually-oriented in that each
control displays real data. As a result, this is a very useful view for setting the size of controls
or performing many other tasks that affect the visual appearance and usability of the form.
Design View - this view gives you a more detailed view of the structure of the form. You can
see the header, detail, and footer sections for the form. You cannot see the underlying data
while you are making design changes.
5.5 Creating Reports
Different Views:
Print Preview – allows you see what the report would look like on a printed piece of paper
Report View – allows you to see the data without having to display it in Print Preview
Layout View – allows you make design changes while browsing your data
Design View - gives you a more detailed view of the structure of your report
5.6 Procedure of printing database objects:
To print a table
File menu
Provide details
Ok
To print a form:
File menu
Ok
To print reports
File menu
Ok