Primary Key | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Primary Key

What is primary key in sql and what is it for?

6th Jul 2019, 6:01 PM
May Thazin Nyein
May Thazin Nyein - avatar
8 Answers
6th Jul 2019, 6:04 PM
Asmit joy
Asmit joy - avatar
+ 2
Primary key : It's an Entity that is necessary to uniquely identify the each tuple in the table. »primary key generally should not be null. »Primary key may be null for a tuple if and only if it is the only tuple that exists in the table with primary key with null .
19th Jul 2019, 2:17 AM
Våmsî Krîšhnå Reddy
Våmsî Krîšhnå Reddy - avatar
+ 2
Primary key is the combination of unique and notnull i.e., primary key should be unique and not null represents the column should contain some value.
27th Jul 2019, 6:15 PM
PRAKASH BANDI
PRAKASH BANDI - avatar
+ 1
Primary key are used to set a unique value for a columm on a table, that can be used with other table using SELECT statement. Try look for relational databases, that's all about.
6th Jul 2019, 11:36 PM
Mauricio De Martino
Mauricio De Martino - avatar
+ 1
A primary key is a field in a table which uniquely identifies each row/record in a database table.
10th Jul 2019, 5:44 AM
omkar
omkar - avatar
+ 1
In simple terms, a primary key is a column which uniquely identifies each record in the table. It can not be null and cannot have duplicate values.
10th Jul 2019, 6:08 PM
Kajal Jain
+ 1
primary key is combination of not null and unique. not null represents that the column should exist some value and unique key represent, the column should not have repeated value.
13th Jul 2019, 6:10 PM
Krishna Venkatesh
Krishna Venkatesh - avatar
+ 1
Primary key uniquely identify column and doesn’t allow null value
14th Jul 2019, 4:18 PM
Martha