Microsoft Access Training

Creating Databases and Tables

Create a new Microsoft Access database and build properly designed tables with field names, data types, descriptions, and primary keys.

Start here

Overview

This lesson turns the No Fault Travel database design into a working Access file. You will create the database, build tables in Design View, select field types, define primary keys, and save the objects.

What You Will Learn

  • Create and name a new Access database file.
  • Create tables in Design View.
  • Enter clear field names without unnecessary spaces.
  • Choose appropriate field data types.
  • Add useful field descriptions.
  • Create AutoNumber primary keys.
  • Use Number fields for related foreign keys.
  • Save, close, and reopen database tables.

Before You Begin

  • Access terminology
  • Relational database design
  • Primary and foreign key concepts

Why This Matters

Field names, data types, and keys determine what information a database can store and how reliably its tables can later be related, queried, and reported.

Plan Your Study

  • Create the No Fault Travel database file.
  • Build the Travel Agents table.
  • Review the available Access field data types.
  • Set the primary key and save the table.
  • Create the Clients and Trips tables in Design View.
  • Verify that foreign-key fields use compatible data types.

Next step

Read the complete chapter.

The Learn tab contains the written lesson from Surviving Statistics.

Go to Learn

Written lesson

Learn Creating Databases and Tables

Create a new Microsoft Access database and build properly designed tables with field names, data types, descriptions, and primary keys.

Advertisement

Creating a new database

In these step-by-step instructions you will learn to create a new database in Access with multiple tables. You will also learn about field types and descriptions and the importance of the Primary Key. Additional lessons will help you crated forms, reports, and queries.

Creating the Access database file

Before you can create tables, you must create the Access file that will hold the database tables, forms, queries, and reports. You will use this file name to open the database when you wish to use it.

1. Start Microsoft Access.

You may start Access from either the Desktop or the Start menu. How you start Access depends on your computer.

Microsoft Access lesson screenshot CreatingDatabase1

Each time you start Access you will see this screen, the Backstage view, which lets you open a new or existing database file. The default option (marked by the arrow above) is creating a new blank database. You can also open an existing database file using the menu on the left side.

When creating a new database, you can also select a premade database template on this screen. We will choose a blank database in this course, not only to learn the features of Access, but also because a custom designed database is tailored to your needs.

2. Click Blank Desktop Database to create a new database.

Microsoft Access lesson screenshot CreatingDatabase2

You will now be prompted to name the Access database file. A default location is selected, but you can also select its location.

1. If needed, you can click the browse tool to store this file in another drive or folder. After selecting the desired folder, enter No Fault Travel as the file name and then click the Create button.

You have now created the Access file that will hold the tables and other objects of this database.

Microsoft Access lesson screenshot CreatingDatabase3

You will now create the first table for the No Fault Travel agency database. To further emphasize the structure of databases, we will have you create your tables in Design View. Later, as you better understand database structure, you can use the tool in the Add & Delete group to add fields to your tables. Overall, while it may be more complex in the beginning, the Design View allows you to see the entire structure of your tables.

Microsoft Access lesson screenshot CreatingDatabase4

2. In the Views group on the left side of the ribbon, click the View button to change the table view to Design View. (Note: You can also accomplish this by clicking on the drop-down arrow.)

The Save As dialog box appears. You will now name this table.

Microsoft Access lesson screenshot CreatingDatabase5

3. Type Travel Agents in the text box and click OK.

Access has named this table Travel Agents and switched to Table Design view, which allows you to create or modify a table. You can specify the name, data type, and description for each field in a table using Table Design view. You can also set Field Properties, which you will learn about later in this course.

Field Names

Field names can be up to 64 characters long and consist of letters or numbers. Although spaces can be included in a field name, you should avoid them if you wish to later integrate your Access database with other database systems.

4. Replace ID with AgentID as the name of the first field in this table and then press (Tab).

You are now in the Data Type column, where you can specify the type of information. When you create a new table, Access will name the first field ID and set it as the Primary Key. By default, the Data Type is set to Auto Number. If you would prefer another name for your first field, you can change it as you did here.

You will now view the different data types available in Access.

5. In the Data Type column, click the drop-down list to display the various field types.

Microsoft Access lesson screenshot CreatingDatabase6

Field types

As you can see from the list, there are several field types. A definition of the field types is as follows:

Short Text: Short text fields hold alphanumeric information such as names and addresses. You should also use text fields to store numeric information that you will not use in calculations such as zip codes. Short Text fields can hold a maximum of 255 characters.

Long Text: Long text fields hold the same kind of information as short text fields. However, memo fields can store a maximum of 65,535 characters.

Number: Number fields hold numeric information that you intend to use in computations such as quantity or temperature.

Date/Time: Date/Time fields hold dates or times. You can view and enter this information in various formats. Storing dates and times in this field type also allows you to perform computations with your date and time data.

Currency:Currency fields hold numeric information. However, numbers stored in this field type will automatically be displayed in currency format ($33.44) for example. Currency fields would be used for fields like PayRate and Price.

AutoNumber: An Autonumber field type generates a unique sequentially increasing number for each new record. In tables created by default, the first field in a blank Access table is the primary key named ID of field type, AutoNumber. However, other fields containing unique information such as social security number can be used for the primary key and Autonumber is a useful field type to provide sequential numbers even when not used as a primary key.

Yes/No: Yes/No fields contain only the values Yes or No. Use this field type for enabling certain categories or answering simple yes or no questions. For example, a field named Active Customer would be a Yes/No field.

OLE Object: Use this field type when you want to store graphic information, such as a client’s photograph.

Hyperlink: A hyperlink lets you store a link to something else. You could, for example, have a field named Vendor Web Site. Storing the vendor’s Internet address in a Hyperlink field would enable you to quickly link to their site directly from Access. You can also use this field type to link to a document in Word or Excel.

Attachment: Attachment fields let you attach files such as pictures, documents, or spreadsheets to the record.

Calculated: Calculated fields allow you to perform computations based on other fields in the table.

6. Choose AutoNumber as the data type for the AgentID field and press (Tab) to move to the Description column.

When choosing a data type, you can just type the first letter of the data type to move to that data type. Typing an “s” for example, moves to the Short Text type.

Field Descriptions

Field descriptions are optional. However, the text you type in this column will show up on the status bar at the bottom of the screen when you are in that field. The field description is a good way to inform users what the field’s purpose is and how it works.

7. In the field description for AgentID type: This is the primary key. Access will fill this value in for you and then press (Enter).

You entered this description so users of this database will know they should not attempt to enter information into this field.

Microsoft Access lesson screenshot CreatingDatabase7

8. Name the next two fields, FirstName and LastName, with Short Text as the data type and no descriptions.

Both of these fields will be short text fields. You do not need a description for these fields.

The first table for the No Fault travel agency is now complete. It has been constructed to store each travel agent’s ID, first name, and last name.

Setting the Primary Key

As mentioned when discussing the AutoNumber field type, Access automatically sets a primary key when it creates the first field in a new table. Although you can change the primary key to another field, using the first field in the table as the primary key is a good practice. You can set or unset a primary key by clicking Primary Key in the Tools group on the Table Tools Design tab.

Microsoft Access lesson screenshot CreatingDatabase8

Saving the Table

Now that you have added all the fields to this table, you are ready to save the table.

1. Click the Save icon on the Quick Access bar.

Microsoft Access lesson screenshot CreatingDatabase9

You will now close the Travel Agents table so you can create another table.

2. Click the small x in Travel Agents tab.

You are closing only the table. The Access database file will remain open.

Microsoft Access lesson screenshot CreatingDatabase10

You should see Travel Agents in the list of tables in the All Access Objects navigation pane on the left. In the next steps, you will create two additional tables for the No Fault travel agency database.

First, you will create a table to store information about the travel agency’s clients.

Microsoft Access lesson screenshot CreatingDatabase11

3. Display the Create tab and click the Table Design tool in the Tables group.

You will be working in the Table Design View to create this table. Directly choosing to create a Table Design (instead of first creating a Table) saves the step of having to switch into Design View. Also note, when you create Table Design, rather than a Table, the first field is not automatically set as the primary key with field name ID of type AutoNumber.

Microsoft Access lesson screenshot CreatingDatabase12

4. Enter the field names, types and descriptions as shown. Be sure that the Data Type for the field ClientID is set to AutoNumber. Set the Data Types for the AgentID field to number and the DOB field to Date/Time.

You are setting the AgentID field to number so that you can enter the number Access assigns the agent in the Travel Agents table. If you used Auto Number here, Access would automatically fill in the field for your and it might not match any agent in the firm.

You will add formatting to these fields later too ensure consistency in the way users enter data, such as date of birth and phone number.

Although Access does allow spaces in field names, learning not to use them is a good practice in the long run because some of Access’s intermediate and advanced features are easier to use when spaces are not present. Furthermore, other database systems like SQL and MySQL do not always work well with or allow the use of spaces in field names.

Microsoft Access lesson screenshot CreatingDatabase13

5. Move into the ClientID field and click the Primary Key tool to set this field as the primary key.

Microsoft Access lesson screenshot CreatingDatabase14

6. Save this table as Clients and then close it.

Notice that both the Clients and Travel Agents tables are visible in the Access objects pane.

You will now create a third table to store the trips that clients have booked.

1. On the Create tab, click the Table Design tool.

Microsoft Access lesson screenshot CreatingDatabase15

2. Enter the field names, data types and descriptions as shown.

3. Make the TripID field the Primary Key of this table.

To do this, move into the field and click the Primary Key tool on the ribbon.

Microsoft Access lesson screenshot CreatingDatabase16

4. Save this table as Trips and then close it.

Microsoft Access lesson screenshot CreatingDatabase17

You now have three tables in this database file, No Fault Travel. These tables will hold the records you enter in this database. You will be adding additional database objects such as forms, queries, and reports as you continue the lessons in this workbook.

Microsoft Access lesson screenshot CreatingDatabase18

5. Click the File tab to open the Microsoft Office backstage view. Select Close to close the No Fault Travel Access file.

You have closed the database for the No Fault travel agency. Now you can create a new database or open an existing database.

Advertisement

Next step

See the concepts demonstrated.

Continue to Watch for chapter videos and worked examples.

Go to Watch

See it explained

Watch

Choose the explanation or example that best supports your learning.

Instructional videos will be added later.

Next step

Apply what you have learned.

Use the guided questions and activities in Practice.

Go to Practice

Apply what you learned

Practice Creating Databases and Tables

Create the No Fault Travel database and build the Travel Agents, Clients, and Trips tables described in the lesson.

Guided Practice

  • Create a blank database named No Fault Travel.
  • Create the Travel Agents table with AgentID, FirstName, and LastName.
  • Set AgentID to AutoNumber and make it the primary key.
  • Create the Clients table using appropriate field types.
  • Create the Trips table and identify its primary and foreign-key fields.
  • Save each table with the correct name.

Challenge Yourself

  • Add meaningful descriptions to fields that may be unclear to future users.
  • Review each field and justify the selected data type.
  • Identify any fields that should not use AutoNumber even though they contain numbers.
  • Create a brief data dictionary listing each table, field, type, and purpose.

Check Your Understanding

  • Can you explain why ZIP codes are usually Short Text rather than Number?
  • Can you explain why a foreign key should not normally be AutoNumber?
  • Can you distinguish Date/Time, Currency, Number, and Short Text fields?
  • Can you explain the purpose of a field description?

Next step

Save the materials you may need later.

Open Resources for the study sheet, spreadsheets, and related learning materials.

Go to Resources

Keep learning

Resources

Study sheets, downloadable files, companion tools, and related lessons for this chapter.

For educators

Teaching this chapter?

The Instructor tab contains objectives, teaching ideas, assessments, and a printable guide.

Open Instructor Resources

LutherMaddy.com — Helping Humans Learn

Creating Databases and Tables: Instructor Resources

Teach this lesson

Instructor Resources

Classroom-ready objectives, teaching ideas, questions, and assessment materials for this chapter.

Learning Objectives

  • Create and save a new Access database.
  • Create tables in Design View.
  • Choose appropriate field names and data types.
  • Add useful field descriptions.
  • Set AutoNumber primary keys and compatible foreign-key fields.
  • Save and close tables correctly.

Prerequisite Knowledge

  • Access terminology
  • Relational design
  • Primary and foreign keys

Teaching Outline

  • Create the database file.
  • Build the Travel Agents table.
  • Review Access data types.
  • Set and explain the primary key.
  • Create Clients and Trips in Design View.
  • Verify field types and save all objects.

Key Concepts

  • Field type controls what data a field can store.
  • AutoNumber is useful for generated unique identifiers.
  • Related key fields must use compatible types.
  • Descriptions guide future data-entry users.
  • Design View provides complete control over table structure.

Classroom Demonstration

  • Compare a ZIP-code field stored as Number and Short Text.
  • Show why a foreign key should match an AutoNumber key with Number/Long Integer rather than another AutoNumber.

Questions to Ask

  • Why should field names avoid unnecessary spaces?
  • When should numeric-looking data be stored as text?
  • Why is an automatically generated key often useful?

Teaching Notes

  • Check field types before students enter records.
  • Emphasize that database file names and table names are different.
  • Have students save frequently while designing tables.

Assessment Ideas

  • Create the three No Fault Travel tables.
  • Submit a field-name and data-type inventory.
  • Explain each primary and foreign key choice.

Grading Rubric

CriterionPoints
Database created and named correctly1
Tables and fields created correctly3
Data types selected appropriately2
Primary and foreign keys configured3
Objects saved and organized1
Total10

Exam and Discussion Questions

Basic

  • Choose an appropriate field type for ZIP code, pay rate, date of birth, and primary key.

Applied

  • Create a Clients table with a primary key and a foreign key to Travel Agents.

Conceptual

  • Explain why a foreign-key field should not generate its own AutoNumber value.

Keep Exploring

Continue Learning

Explore step-by-step lessons, interactive calculators, downloadable study sheets, and practical educational resources.