IN A TABLE HAVE ONE COLUMN PRIMARY KEY..IT WILL NOT ALLOWS
NULL VALUES AND DUPLICATE VALUES..INSTEAD OF PRIMARY KEY
WHY CANT WE USE UNIQUE AND NOT NULL.THESE TWO ALSO DOESNT
ACCEPT NULL VALUES IN NOT NULL AND UNIQUE DOESNT ACCEPT
DUPLICATE VALUES?
SO WHAT IS THE DIFEERENCE BETWEEN(UNIQUE,NOT NULL) AND
PRIMARY KEY??????

Answer Posted / prativa mishra

We can create more unique key in a table but we can not create more then one primary key in a table.At the time of primary key creation thr is a clusterd index created automatically and it sorts data physically. It helps in searching process which not possible in unique+notnull column

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you modify a column in sql?

647


what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba

735


What is difference between stored procedure and trigger?

634


Advantages and disadvantages of stored procedure?

695


how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba

916






How to get unique records from a table?

600


mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql

668


What is Difference Between Unique and Primary Key Constraints?

698


What is the starting oracle error number?

646


how to concatenate two character strings? : Sql dba

639


Can variables be used in sql statements?

644


what are string data types? : Sql dba

601


How many triggers can be applied to a table?

695


How do you optimize a stored procedure query?

653


Is sql a case sensitive language?

623