Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can any explain the composite primary key in SQL?

1 Answer

0 votes
by (119k points)

Composite primary key or Composite key is a combination of two or more than two columns to uniquely identify the records of a table but if it is taken individually does not guarantee uniqueness.

You can specify the composite key as follows:

CREATE TABLE Table_Name 

(COLUMN_1, DATA_TYPE_1,  

COLUMN_2, DATA_TYPE_2,  

…….

PRIMARY KEY (COLUMN_1, COLUMN_2, ...));  

If you wish to learn SQL from Industry experts then check out this SQL Course by Intellipaat that provides instructor-led training, and also certification.  

Related questions

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
asked Oct 20, 2020 in SQL by dev_sk2311 (45k points)
0 votes
1 answer
asked Oct 20, 2020 in SQL by dev_sk2311 (45k points)

Browse Categories

...