Primary Keys and Indexing

2
Primary keys and Indexing A primary key is used as an unique identifier within a record in a database table and is useful when working with relational tables. To be effective primary key cannot have duplicate entries and must be set on a field generating a unique identifier. When creating a new table access automatically adds ID field with an Autonumber data type. By default ID field is also a primary key. Other fields used as a primary key is unique to each individual. A primary key cannot be empty. Access also uses primary keys to index table. Indexing Access use indexes much like the table of contents, to help locate information and sort quickly. An index stores the location of records based on the fields or the fields that you choose to be index. After the access obtains the location, it can retrieve the data based on the location. Access sets the primary key as index. But you can set another field as also fields as index that are frequently used for searching.

description

access

Transcript of Primary Keys and Indexing

Primary keys and IndexingA primary key is used as an unique identifier within a record in a database table and is useful when working with relational tables.To be effective primary key cannot have duplicate entries and must be set on a field generating a unique identifier. When creating a new table access automatically adds ID field with an Autonumber data type. By default ID field is also a primary key. Other fields used as a primary key is unique to each individual. A primary key cannot be empty. Access also uses primary keys to index table.IndexingAccess use indexes much like the table of contents, to help locate information and sort quickly. An index stores the location of records based on the fields or the fields that you choose to be index. After the access obtains the location, it can retrieve the data based on the location.Access sets the primary key as index. But you can set another field as also fields as index that are frequently used for searching.The index can be set to the fields that has data type as Text, Memo, Yes/No, Number, Date/Time, Currency, Hyperlink..Indexing can also be set on multiple fields. We can set upto 10 and order it in multiple field index.Before creating index decide to create a single field index or multiple field index.