answersLogoWhite

0

A primary key uniquely identifies a row in a table. A table without a key is not in normal form (i.e. considered a bad practice). Without a primary key, a database programmer risks inadvertently updating or deleting more records than they intended.All tables should have a primary key, although this key may be a composite of various fields.

For example, if a developer uses "update contacts set firstname = 'John' where firstname='Jacob' and lastname = 'Smith'", they will likely update many records when they may have only intended to update a single record. By using a unique key, a developer can instead state "update contacts set firstname = 'John' where uid = 1234", and only a single record will be updated.


Primary keys also increase access to specific records when the developer knows ahead of time what specific value they are looking for. For example, a developer might display a list of contacts matching a first name and last name, and when the user selects a specific record to view, retrieving by the primary key will be faster than querying by multiple indices (such as first name and last name).

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Have all tables primary key?

No, all tables do not have primary key. Primary must be explicitly defined and must not be null.


Is it necessarily that a foreign key is primary key in other table?

It is not mandatory that is must be a primary key but it must be a unique key in the other table.


What does the primary key in a data base do?

We know that primary key is the one that is not null and is always unique. A primary key uniquely identifies a record in a table.


What are the advantage of primary key?

Primary key that is used to identify a record uniquely. Primary key is a key that always unique and not null. A system generated primary key is called surrogate key.Primary key is the one which is always unique and not null. Advantage of primary key that it helps in identifying a tuple uniquely.


What not a likely primary key?

A field that is not unique and null can not be used as a primary key. Praimary key must satisfy the conditions of not null and unique.


Why must the primary key of a parent table be determined before the foreign key in the child table?

Because the foreign key is copied from the primary key of the parent table


Why do you designate one of the candidate key of relation to be the primary key?

We designate one of the candidate key of a relation to be a primary key because that primary key is use for any foreign key references.


What is a primary key what is its purpose and why do you use it?

What is a Primary Key?The PRIMARY KEY constraint uniquely identifies each record in a database table.Primary keys must contain unique values.A primary key column cannot contain NULL values.Each table should have a primary key, and each table can have only ONE primary key.The primary key is defined by using the PRIMARY KEY constraint when either creating a table or altering a table.*Example of primary key :- customer Nowhat is its purpose and why do you use it?In relational database design, a unique key or primary key is a candidate key to uniquely identify each row in a table.


Why you need primary key and foreign key?

In sql you use primary key more than one column in a table


Which field MS Access will not allow you to delete?

A primary key field.A primary key field.A primary key field.A primary key field.A primary key field.A primary key field.A primary key field.A primary key field.A primary key field.A primary key field.A primary key field.


Describe four uses of primary key?

To uniquely identify a record, as every primary key value must be unique. To ensure every record has a key, as a primary key cannot be left blank. To be used in creating relationships. For sorting and searching records.


What is A field that uniquely identifies a particular record in a table called?

A field that uniquely identifies a particular record in a table is called a primary key. The field or fields on which records are sorted is called the sort key.