Anda di halaman 1dari 3

You can create a blank database and then add the tables, and other objects later.

To create a blank database you should follow the following steps:


1. Click New on the toolbar.
2. In the New File task pane, under New, click Blank Database.
3. In the File New Database dialog box, specify a name and location for the
database, and then click Create.

The Database window appears, and you can create the objects (tables, queries and so
on) that you want in your database.

Create a table (MDB)

To create a table in Design view

1. Press F11 to switch to the Database window.


2. Click Tables under Objects, and then click New on the Database window
toolbar.
3. Double-click Design View.
4. Define each of the fields in your table.

How?

1. Open the table in Design view.


2. To insert the field within the table, click in the row below where you
want to add the field, and then click Insert Rows on the toolbar.

To add the field to the end of the table, click in the first blank row.

3. Click in the Field Name column and type a unique name for the field.
4. In the Data Type column, keep the default (Text); or click in the Data
Type column, click the arrow, and select the data type you want.
5. In the Description column, type a description of the information this
field will contain. This description is displayed on the status bar when
adding data to the field and is included in the Object Definition of the
table. The description is optional.
6. Define a primary key field before saving your table.

How?

7. Open a table in Design view.


8. Select the field or fields you want to define as the primary key.

To select one field, click the row selector for the desired field.

To select multiple fields, hold down the CTRL key and then click the row selector for
each field.
9. Click Primary Key on the toolbar.

Note You don't have to define a primary key, but it's usually a good idea. If
you don't define a primary key, Microsoft Access asks if you want Access to
create one for you when you save the table.

10. When you are ready to save your table, click Save on the toolbar, and
then type a unique name for the table.

Exercise:

1. create a database and name it “Library”


2. create the following table and their attributes:

Books (Title, ISBN, Price)


Authors (AuName, AuPhone, AuID)
Publishers (PubName, PubPhone, PubID)
3. create a relationship as follows:
Add PubID field to Books table
Create a table Book_Author (ISBN, AuID)
Figure 3.1 The Relationships view

Figure 3.1 Relationship between the PUBLISHERS and BOOKS table

Anda mungkin juga menyukai