Is the primary key and auto increment the same?&?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is the primary key and auto increment the same?&??

26th Mar 2016, 11:49 PM
Eli Wolfe
Eli Wolfe - avatar
4 Answers
+ 1
no but it can be auto increment has all they basic property required for a primary key but it can be case that there are more than one auto increment columns or more than one distinct columns . here only one will be primary
14th Jul 2016, 8:11 PM
manish rawat
manish rawat - avatar
+ 1
A column can definitely be an identity without being a PK. An identity is simply an auto-increasing column. A primary key is the unique column or columns that define the row. These two are often used together, but there's no requirement that this be so.
17th Dec 2016, 4:02 AM
Yasir Arafath
0
The answer is no. For example you can create a table with passport number as primary key and without auto-increment condition. But when you want to create and ID column to sequentially identify each row is better to use auto increment than doing by yourself.
30th Mar 2016, 1:10 AM
Pablo Mazzocchi
0
Yes and Not. Autoincrement can only be the primary key; but primary key can be other such as social id
5th Jul 2016, 5:53 AM
Rafael Valverde
Rafael Valverde - avatar