answersLogoWhite

0

A primary key is always unique and not null. It is prefer to choose a field that is unique like roll number . But to choose Last name as a primary key is not a good option as two people can have same last name.

A Last name field is not a good one for a primary key. A primary key cannot have duplicate values. A last name field is highly likely to have duplicate values, so it should not be used as a primary key.

User Avatar

Wiki User

10y ago

What else can I help you with?

Continue Learning about Law

What does the term foreign key mean in databases?

The foreign key is used as a reference in a table to the primary key of another table. For example: consider a table employee with id(primary key), name, address,department_id(foreign key) as its fields.Another table department with fields department_id(primary key) and dept_name. So, department_id is primary key in department table and foreign key in employee table.


Can a primary key be a foreign key?

Yes, a primary key can also be a foreign key. This is known as a composite key, where one or more columns in a table are both primary keys for that table and also act as foreign keys linking to another table.


What is the condition for a key to be a foreign key?

A key is considered a foreign key if it references the primary key of another table to establish a relationship between the two tables. It enforces referential integrity, ensuring that data in the foreign key column corresponds to data in the primary key column.


How can a Foreign Key and a Primary Key interact with each other?

In some database systems, A Foreign Key that is set on one column (the child column ) has to point to another column (the parent column ) that is indexed. The parent column could be a primary key, since a primary key creates an index. Primary keys also keep values in the parent column unique, which can ensure unique records in the parent column's table; having a unique key on the child column can further enforce unique data that links with the unique records in the parent column .


When using last name first where do you place Jr?

When using last name first, Jr. is placed at the end of the full name. For example, Smith, John Jr.

Related Questions

Another name for the primary key is the key?

Index key


Can your husbands ex use his last name as her primary last name even if she has been married and divorced and is currently married and still uses his last name as her primary last name?

no


Can the FirstName column be a primary key?

A First name field is not a good one for a primary key. A primary key cannot have duplicate values. A first name field is highly likely to have duplicate values, so it should not be used as a primary key.


What is another name for a primary key?

Also called a Key field.


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.


Can super key be as primary key?

I think super key is treated as the primary key because in a table their will be only one primary key.


What are the importance of primary key?

Importance of primary key


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 is the primary key for the properties table?

Primary key is to set property ID as the primary key for the properties table.


How you create or assign primary key?

A primary key is never null and is also unique . Example of primary key is create table emp (ecode integer NOT NULL PRIMARY KEY);


Why must you use a primary key?

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).