0 votes
1 view
in SQL by (9.3k points)
What is Primary Key in SQL?

1 Answer

0 votes
by (26.6k points)

Primary Key in SQL is a field in the table that helps to identify each row available in the database table in a unique manner. It consists of unique values and it cannot contain null values. Every table can contain only a single primary key that may include one or more fields. If a primary key is a combination of more than a single field then it is a composite key.

Following are some of the features and characteristics of a primary key:

  • A table can contain only one primary key
  • It consists of at least one column
  • It enforces the integrity of the entity in the database table
  • None of the columns should contain any null value
  • By default, these keys result in unique and clustered indexes

To know more about primary keys, read this comprehensive SQL Tutorial.

To build a career in SQL and become proficient in it, you must sign up for SQL Training. In this course, you will work on industry-based projects that will enhance your learning and give you hands-on experience in solving real-time projects.

Also, check out this YouTube video on SQL:

Related questions

0 votes
1 answer
asked May 3 in SQL by Sudhir_1997 (24.1k points)
0 votes
1 answer
asked Apr 22 in SQL by Sudhir_1997 (24.1k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...