Vous êtes sur la page 1sur 8

Information technology

Grade: 9

November 14, 2016

Topic: Foundations of hardware and software

Subtopic: Database management

Objectives

At the end of the lesson students should be:

1. able to define the terms


a. Data ,
b. Database
c. Data Base Management System (DBMS),
d. Data Base table/file,
e. Data Base field,
f. Record
g. Primary key,
h. foreign key and relationships

2. Create Data Base tables according to specific guidelines.

Copy the following to your note books


Database
A collection of data files that may be used by a number of applications with storage and access
to the data controlled by a set of programs known as Database Management System. (DBMS).

Database management systems (DBMS)


A database management system is the term for programs that handle the storage, retrieval of
information and modification of data.

Field
Part of a record on a database. Computer databases are arranged, searched and sorted by
field.

Record
A collection of fields on data related to one entity.

Primary key

In order for a table to qualify as a relational table it must have a primary key.
The primary key consists of one or more columns whose data contained within is used to
uniquely identify each row in the table. You can think of the primary key as an address. If the
rows in a table were mailboxes, then the primary key would be the listing of street addresses.

Foreign Keys
A foreign key is a set of one or more columns in a table that refers to the primary key
in another table. There isnt any special code, configurations, or table definitions you
need to place to officially designate a foreign key.

Relationship
A relationship, in the context of databases, is a situation that exists between two
relational database tables when one table has a foreign key that references the
primary key of the other table. Relationships allow relational databases to split and
store data in different tables, while linking disparate data items.

Task A

Create Access 2007 Database


The first step in creating an Access 2007 database, is to create a
blank database file. This is done from the Getting Started Screen
when you launch Access. The file is saved onto one of your PCs
folders (which you specify). The procedure for doing this is outlined
below.
1. Launch Access
To begin, launch Access by clicking on the desktop icon, or choose
Access from the start menu. This brings up the GETTING STARTED
WITH MICROSOFT OFFICE ACCESS screen.

2. Select Blank Database Template

Towards the top left of the screen you will see a "Blank Database"
icon. Click this icon to bring up the Blank Database side bar on the
right hand side of the screen. This is where you will enter details
about the database file that you are about to create.
3. Enter filename for your Access 2007 database

Begin by entering the name that you want to call the database in
the filename textbox.

4. Browse and select folder


Next click the folder icon and browse for a folder to put your
database. Once selected you should see the file path below the
textbox.
5. Click Create
All you need to do now is click the "Create" command button below,
and your database file saves to the location that you specified, and
opens for you to work on.
You are now ready to work on your newly created database file. The
next step is to create an Access table

Task B
Create Access Table

1. Open database file


If you created a blank Access database in the previous tutorial
lesson, you are now ready to create a new table. Begin by opening
your existing database file if it is not already open. Do this by
clicking on the Access desktop icon to bring up the getting started
screen again. You should see the file name that you just created
towards the top of the right hand side bar (If you cant see it, click
the folder icon to browse for the file). Click on the file name to bring
up your blank database.
If, at this stage, you get a security warning underneath the ribbon,
click where it says options, select the "enable this content" radio
button (in the pop-up window), and then click ok.
Your blank database file should now be fully open.

2. Create Access Table


Select the CREATE tab on the Access ribbon. Next select the TABLE
DESIGN icon from the TABLES group. This creates a new table.

3. Create fields in DESIGN VIEW


This brings up the TABLE DESIGN GRID where you enter each field
name and its data type. The first field we are going to create is the
ID field which is going to contain a unique reference number for
each record. Enter the name "ID" into the first column of the first
row in the grid. Because we want Access to automatically generate a
unique reference number, select AUTONUMBER from the drop down
list in the data type column. You can also enter a description for
each field, but this is not essential.
On the next row the field is going to be called FIRSTNAME and the
data type is going to be TEXT. On the third row the field name is
SURNAME with the data type again being TEXT. And finally, the last
field name is AGE and the data type here is going to be NUMBER.

Before you save the table you will need to choose the Primary Key,
which in this case is ID. To do this, select the ID row by clicking on it,
and then simply click the primary key symbol on the Ribbon.

The table design grid should now look like this:

You can now save the table by clicking the save icon on the top left
of the screen above the Access Ribbon. To view your table select
DATASHEET VIEW from the VIEWS group under the DESIGN TAB. This
brings up the datasheet view of the table that you have just created.
You should see your field headings running across the top of the
table.

4. Data entry in DATASHEET VIEW


Although entering data onto the datasheet table is not a part of the
design process, the table now exists as a database object, and you
can test it by entering some information into the cells.
Select the first cell in the FIRSTNAME column and enter the name
JOHN. For SURNAME enter JONES, and for AGE enter 35.

NB just ignore the column underneath the heading ADD NEW FIELD.
We created all the fields we needed in design view.
You have now entered the first record in the table - record 1 for John
Jones aged 35. You can now press the return key and the record will
save automatically. You are now ready to enter the second record on
the next row - TRACEY SMITH 25. Press return and then fill in the
data for the last record we are going to do for now - ANNE McNEIL 30
Your datasheet table should now look like this:

Use the information you collected in the last class to create and populate
a table using the field s which you were given. These are Last name, first
name, age, favorite subject and favorite sport.

Vous aimerez peut-être aussi