Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Imus Computer College

Microsoft Access Database Activity

Creating Tables:

1. Table Name: BOOKS

Fieldname Data type Field properties


BookID Autonumber “BK-“000 format
Title Short text (text) > format
Author Short text (text)
Price Currency
 Enter at least 10 records.

2. Table Name: STUDENTS

Fieldname Data type Field properties


StudentID Autonumber “ICC-“000 format
Lastname Short text (text)
Firstname Short text (text)
EmailAdd Hyperlink
ContactNumber Number (0000)000-0000 input mask
Town Lookup wizard Type at least 5 towns
Course Short text (text)
YearLvl Short text (text)
Session Short text (text)
 Enter at least 10 records

3. Table Name: BORROWED/RETURN

Fieldname Data type Field properties


StudentID Number “ICC-“000 format
BookID Number “BK-“000 format
Title Short text (text) > format
DateBorrowed Date/Time
DateReturned Date/Time
DueDate Date/Time
Penalty Currency
 Enter at least 5 records.

Creating Relationships:

1. Close All tables and forms


2. Activate the Database Tools Tab.
3. Click the Relationships button in the Show/Hide group.
4. Click the Show Table button in the Relationships group. The Show Table dialog box appears.
5. Double-click each table or query you want to use to build a relationship.
6. Click the close button to close the Show Table dialog box.
7. Drag the (StudentID field) from the Students table over the Borrowed/return table (StudentID field). The Edit
Relationships Dialog box appears.
8. Click the Enforce Referential Integrity checkbox.
mbpalustre@yahoo.com
9. Click Create. Access creates a one-to-many relationship between the tables.
10. Repeat the #7-9 for BookID fields of Books and Borrowed/return.
11. Click the Save button to save the relationship.

Creating Query:

To create a Query that uses two or more tables

1. Activate the Create Tab.


2. Click Query design.
3. Open the Tables you want to use in Query Design view.
4. Choose the fieldnames you want to retrieve in the order you want to retrieve them. Drag the following fields.
5. From the Books table: BookID, Title.
6. From the Borrowed/return table: StudentID, DateBorowed, DueDate, DateReturned.
7. Click the Run button. Access retrieves the columns you choose and displays the rows in the order you specified.
8. Click Save button. Type the query name: Books
9. Click OK. Access saves the query.

To create a Parameter Query

1. Activate the Create Tab.


2. Click Query Wizard. Click OK.
3. On the Simple query wizard dialog box. Select table: Students. Click the >> button. Click next.
4. Type the title: Students Query. Select Modify the query design. Click finish.
5. On the Criteria line under Town Field, type the prompt [Which Town?] within square brackets.
6. Click the Run button. Access prompts you.
7. Respond to prompt.
8. Click OK. Access displays the results of your query in Datasheet view.

To create a Transaction Query

1. Activate the Create Tab.


2. Click Query design.
3. Open the Tables you want to use in Query Design view.
4. Choose the fieldnames you want to retrieve in the order you want to retrieve them.
5. From the Students table, drag the following fields. StudentID, Lastname, Firstname.
6. From the Borrowed/return table: BookID.
7. From the Books table: Title.
8. From the Borrowed/return table: DateBorrowed, DueDate, DateReturned, Penalty
9. Click the Run button. Access retrieves the columns you choose and displays the rows in the order you specified.
10. Click Save button. Type the query name: Transaction Query
11. Click OK. Access saves the query.

mbpalustre@yahoo.com

You might also like