What s in a Table?

What's in a Table?

You learned about some of the basic parts of a table in Chapter 4, "Planning a Database." But before you actually build a table, you should review the three basic components one more time:

  • Fields

  • Records

  • Primary key

Note

graphics/nman.gif

You can download the Chapter 5.mdb sample file, which is inclusive of all the examples in this chapter, from http://www.quepublishing.com/.


Fields

A field is the smallest unit of data in the database. In the plants database, some of the fields are CommonName, LatinName, StreetAddress, and City. Each thing you store in the database is described by one or more fields. As part of the process of designing tables, you'll tell Access which fields belong in each table.

Records

When you fill in the fields in a table, you're creating a record . A table might contain no records at all (if you haven't entered any data yet), or it might contain hundreds, thousands, or even millions of records. In the plants database, for example, each individual plant is the subject of one record. You can't enter records in a table before you have defined the fields for that tableuntil then, there's no place to enter the data!

Figure 5.1 shows the connection between fields, records, and tables.

Figure 5.1. Fields and records in a table.

graphics/05fig01.gif

Primary Key

The other thing to keep in mind when building tables is that each table should have a primary key. A primary key , you'll recall, is the field (or group of fields) that uniquely identifies each record in a table. A bit later in the chapter you'll learn how to tell Access which field in your table contains the primary key.

Tip

graphics/tman.gif

If you forget to designate a primary key for a table, Access will remind you the first time you save the table. If you like, it will even create a primary key for you at that point.




Absolute Beginner's Guide to Microsoft Office Access 2003
Absolute Beginners Guide to Microsoft Office Access 2003
ISBN: 0789729407
EAN: 2147483647
Year: 2002
Pages: 124

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net