adspace


If we declare constraints Unique and Not null on a single
column then it will act as a Primary key, so what is the use
of primary key??

Answer Posted / neha sinha

1) Primary key creates clustered index and unique key
creates non-clustered index. Performance wise clustered
index is fast so we need Primary key.
2)if we need more then one primary key in table than we can
use unique key+NOT NULL becous it behave as Primary key but
we cant define more than one column as primary key. :)

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is sql server agent? : Sql dba

1188


Is primary key always clustered index?

1101


If a cursor is open, how can we find in a pl/sql block?

1252


what is bcp? When does it used? : Sql dba

1065


what is collation? : Sql dba

1242


What is the current version of sql?

1106


Is primary key clustered index?

1028


what are all the common sql function? : Sql dba

1141


what are aggregate and scalar functions? : Sql dba

1142


Does group by remove duplicates?

1120


How do I remove duplicates in two columns?

1202


Can we use distinct and group by together?

1146


Is inner join faster than left join?

1287


define sql insert statement ? : Sql dba

1110


what is schema? : Sql dba

1163