ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
What's the difference between a primary key and a unique 
key?
 Question Submitted By :: Swapna
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What's the difference between a primary key and a unique key?
Answer
# 1
Both primary key and unique enforce uniqueness of the 
column on which they are defined. But by default primary 
key creates a clustered index on the column, where are 
unique creates a nonclustered index by default. Another 
major difference is that, primary key doesn't allow NULLs, 
but unique key allows one NULL only.
 
Is This Answer Correct ?    8 Yes 0 No
Swapna
 
  Re: What's the difference between a primary key and a unique key?
Answer
# 2
There is one more diff b/w primary key and unique key that 
there is only one primary key in a table but there are more 
then one unique keys in a table.
 
Is This Answer Correct ?    4 Yes 1 No
Ramneet
 
 
 
  Re: What's the difference between a primary key and a unique key?
Answer
# 3
Primary can be used in foregin key but unique key does not 
used.
 
Is This Answer Correct ?    3 Yes 0 No
Ramneet
 
  Re: What's the difference between a primary key and a unique key?
Answer
# 4
1)primary key uses clustered index
unique key uses non-clustered index

2)primary key doesn't allow null values
but unique allows one null value

3)there is only one primary key but more than one unique 
keys
 
Is This Answer Correct ?    2 Yes 0 No
Gowthami Radhakrishnana
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is The Use Of TIMESTAMP DataType in SQL Server 2005?  3
how to retrive only second row from table in sql server 2000? CTS7
What is SQL server agent? SAP-Labs2
What types of integrity are enforced by a foreign-key constraint  1
What is a view? is View updatable? IBM11
where do you use Isolations?give me some exmpale?  1
how to get the rowid/rownumbes of a table in sqlserver IBM5
can primery key be a non clustered index?  8
What is the difference between Drop and Truncate  10
What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table HP15
What are the type of joins? When do we use Outer and Self joins?  3
what is maximum size of temp db? iSoft4
As a part of your job, what are the DBCC commands that you commonly use for database maintenance? HCL1
What is ACID Property of Transaction?  4
How are SQL Server databases physically stored under Windows 2000?  1
Say if we have a table that contains only a single column , say OrderID, which has IDENTITY attribute defined on it. So how can we insert data in this table. I am reframing my question, that how can we make the table to increment the column "OrderID" value several times???  3
can you any body tell me suppose database is suspect mode. how can take to normal? Teledata1
is it possible to use a variable in a query with the IN clause (a,b,c..z), without getting quotes or conversion errors?  2
What is the difference between views and stored procedures? Can we have input parameters for views?  3
Explain Trigger with an example?  1
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com