Computer Science, asked by TbiaSupreme, 1 year ago

What is primary key? Explain giving a suitable example?

Answers

Answered by bavatharinib
2

A primary key is a special relational database table column (or combination of columns) designated to uniquely identify all table records.

A primary key’s main features are:

It must contain a unique value for each row of data.

It cannot contain null values.

A primary key is either an existing table column or a column that is specifically generated by the database according to a defined sequence.

For example, students are routinely assigned unique identification (ID) numbers, and all adults receive government-assigned and uniquely-identifiable Social Security numbers.

Answered by gratefuljarette
1

Primary Key:

  • The primary key is the key which consists of either a single row or group of rows that can uniquely identify the rows in a given table.
  • For example consider one employee table with the fields or rows as employee name, employee id, date of birth, date of joining, designation. For the above table employee id can be the primary key for this employee table since this is the field which would be unique i.e. it would be different for different employees and it can never be the same.
Similar questions