.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

Database: How many primary key constraints can be created for one table?

Posted By :shankey     Posted Date :August 01, 2011    Points :40   Category :Sql Server 
Only one primary key constraints can be created for one table.

You can also find related Interview Question to Database: How many primary key constraints can be created for one table?  below: 

Which option is used to drop constraints specified on the table?

DROP option in the ALTER TABLE command is used to drop constraints specified on the table. (More...)

How To retrive Duplicate Records when There is no Primary key in a Table?

select city_name
from areas
group by city_name

having count(*) > 1 (More...)

how to find the table name in sql server database?

select * from INFORMATION_SCHEMA.tables where table_name like 'tblname%' (More...)

How do we get primary key information in oracle table?

we can get primary key information with the following SQL statement

SELECT b.table_name, b.column_name, b.position, a.status, cons.owner
FROM all_constraints a, all_cons_columns b
WHERE cons.constraint_type = 'P'
AND a.constraint_name = b.constraint_name
AND a.owner = b.owner
ORDER BY b.table_name, b.position;

Difference between primary and unique key constraints

Unique Key Constraints
The column values should retain uniqueness.
It allows null values in the column.
It will create non-clustered index by default.
Any number of unique constraints can be added to a table.

Primary Key Constraints
Primary key will create column data uniqueness in the table.
It will not allow Null values.
By default Primary key will create clustered index.
Only one Primary key can be created for a table.

Database should be created as a SINGLE_USER state Whenever you create a new Database. What should you do ?

1. Normally, when we create a new database, All the properties will be inherited from the Model database.

2. So, Just change the Model database's State to SINGLE_USER.

3. Now onwards, The new database will be created as SINGLE_USER state. (More...)

Can indexes be created on more than one column of a table?

Yes, Effective indexes are the one of the best way to improve performance of database application. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend