Anda di halaman 1dari 38

DATABASE APPLICATION SOFTWARE

Learning Outcomes
At the end of the lesson, you should be able to 1. Identify project requirement 2. Design database table 3. Create a database 4. Create two tables that include the primary key in each table 5. Build a relationship between two table (query) 6. Enter data into the table content 7. Create a form that related to the table content

Develop a database project

Figure 1: Opening Microsoft Access

SITUATION A:

You want to create a database of your friends telephone numbers. Majority of your friends have more than one telephone numbers. The data that you will store in your database are Friend ID, Name, Address, Phone Numbers and Date of Birth. You want to create a database of your friends telephone numbers. Majority of your friends have more than one telephone numbers. The data that you will store in your database are Friend ID, Name, Address, Phone Numbers and Date of Birth.

1.

Project title Objective(s)

Phone Book Database To create a database of friend telephone numbers Table 1 Table 2 PHONE_INFO FriendID,Name, Phone_Num1, Phone_Num2 FriendID
PHONE_INFO

2. Table name Field names

FRIEND_INFO FriendID, Name, Address, Date of Birth FriendID


FRIEND_INFO

Primary key The relationship between both tables.

FriendID Name Address Date of Birth

FriendID Name Address Date of Birth

3.

Name of forms

FRIEND_INFO, PHONE_INFO

How To Create Database

Key in the field names related to your tables.

Field Names

Primary key Friend ID

Click File and select Save as, then name your table FRIEND_INFO and click OK Button

To create the second table PHONE_NUM,

Field names for table PHONE_NUM

Build the relationship between two table (query)

Click Tools and select Relationships

Relationship table

Click Show Table icon. Select FRIEND_INFO table. Click Add button

Select PHONE_NUM table Click Add button. Then click Close button.

How to Setup the Relationship

1. Click Relationships

2. Edit Relationships.
3. Select FRIEND_INFO table.

4. Tick Enforce referential Integrity.


5. click Create button.

The result after relationship has been created

Relationship between FRIEND_INFO and PHONE_NUM (Join type: One-to-Many)

How to enter data into the table

Click the Tables tab and double click FRIEND_INFO

Fill all the data given below into the FRIEND_INFO table. After entering all the data, click File and then Close.

Data for table FRIEND_INFO

Click the Tables tab and double click PHONE_NUM

Next, fill all the data given below into the PHONE_NUM table. After entering all the data, click File and then Close.

Data for table PHONE_NUM

How to create a FORM that related to the table content

Click the Queries tab. Select Create query by using wizard

Choose FRIEND_INFO table, move all fields in the Available Fields section by using this icon Into the selected fields section. Then click Next

Choose PHONE_NUM table, then move Phone Numbers field in the Available Fields section into the Selected Fields section using this icon click Next

Type MY PHONEBOOK for your query title. Then click Finish

Naming query

Click PERSONAL PHONEBOOK and click Open button

Opening PERSONAL PHONEBOOK database

Choose any layout given and then click Next.

Choose any style given and click Next.

Type PERSONAL PHONEBOOK for your form title. Then click Finish.

Naming the form

Data is displayed in form

Activity 1

number

text

currency

Date / Time

Activity 2

Anda mungkin juga menyukai