:: Home Page            
 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                      
Categories >> Software >> Databases >> SQL Server


 Oracle interview questions  Oracle Interview Questions (2036)
 SQL Server interview questions  SQL Server Interview Questions (1076)
 MS Access interview questions  MS Access Interview Questions (24)
 MySQL interview questions  MySQL Interview Questions (194)
 Postgre interview questions  Postgre Interview Questions (6)
 Sybase interview questions  Sybase Interview Questions (22)
 DB Architecture interview questions  DB Architecture Interview Questions (5)
 DB Administration interview questions  DB Administration Interview Questions (213)
 DB Development interview questions  DB Development Interview Questions (53)
 SQL PLSQL interview questions  SQL PLSQL Interview Questions (771)
 Databases AllOther interview questions  Databases AllOther Interview Questions (106)
What are constraints? Explain different types of 
 Question Submitted By :: SQL-Server
I also faced this Question!!     Answer Posted By  
# 1
constraint is a rule which can not be voilated by end users.
Different types of constraints are available.They are:-
1)default constraint:-which is used to define a default
2)primary key:-the key which does not allows duplication
and null values.
3)foreign key:-the key used to refer primary key defined
field in another table and it allows duplication.
4)null:-which allows NULL values.
5)not null:-which does not allows NULL values.
6)unique key:-which does not allows duplication but allows
NULL values.
Is This Answer Correct ?    235 Yes 52 No
# 2
Constraints are the constraints which can provide on the
column data.The types of constraints are
1).Domain Integrity constraints
2).Entity Integrity constraints
Ex:Unique,Primary key
3).Referential Integrity constraints
Is This Answer Correct ?    106 Yes 34 No
# 3
Including these it also contains check constraint.
check constraint:-It specifies a range of values witn in
which the attribute should take
Is This Answer Correct ?    92 Yes 39 No
# 4
Constraint : To Restrict the voilation of irrelegular data
and maintain data integrity.

Primary key
Unique Key
Forigen Key
Is This Answer Correct ?    65 Yes 37 No
# 5
Constraint mostly restrict the user from entering violated
data into the table..

Various types of constraints are:
Primary Key Constraint
Foreign Key Constraint
Unique key Constraint
Check Constraint
NOT NULL Constraint
Is This Answer Correct ?    38 Yes 18 No
# 6
. Primary Key Constraint
. Foreign Key Constraint
. Unique Key Constraint
. Check Constraint
Is This Answer Correct ?    36 Yes 25 No
# 7
3 basic types
1.entity constraint:
not null
2.domain constraint:
composite primary key
3.referential constraint:
Is This Answer Correct ?    26 Yes 21 No
# 8
Constraints are used to restrict or protect the data and
accessing from the table
There are 5 types of constraints available,
1.Primary-which is not allowed duplication and Null values
2.Unique-Which is also Not allowed duplication But It is
allowed one single null values
3.Foreign - Which is allowed duplication and Null values.
But It refers Value from primary Key table to its own table
4.Check Constratints
5.Not null
Is This Answer Correct ?    10 Yes 5 No
Kannan G
# 9
Constraints enable the RDBMS enforce the integrity of the
database automatically, without needing you to create
triggers, rule or defaults.

Types of constraints:

A PRIMARY KEY constraint is a unique identifier for a row
within a database table. Every table should have a primary
key constraint to uniquely identify each row and only one
primary key constraint can be created for each table. The
primary key constraints are used to enforce entity
integrity. ( Entity integrity is an integrity rule which
states that every table must have a primary key and that
the column or columns chosen to be the primary key should
be unique and not null)

A UNIQUE constraint enforces the uniqueness of the values
in a set of columns, so no duplicate values are entered.
The unique key constraints are used to enforce entity
integrity as the primary key constraints.

A FOREIGN KEY constraint prevents any actions that would
destroy link between tables with the corresponding data
values. A foreign key in one table points to a primary key
in another table. Foreign keys prevent actions that would
leave rows with foreign key values when there are no
primary keys with that value. The foreign key constraints
are used to enforce referential integrity.

A CHECK constraint is used to limit the values that can be
placed in a column. The check constraints are used to
enforce domain integrity.

A NOT NULL constraint enforces that the column will not
accept null values. The not null constraints are used to
enforce domain integrity, as the check constraints.
Is This Answer Correct ?    3 Yes 2 No
Rahul Shrivastava
# 10
constraint define rules that must be followed to maintain
consistency and correctness of data.a constraint can either
be created while creating a table or can be added later.
constraint can be divided into the following types:--
(1)primary key constraint.
(2)unique constraint.
(3)foreign key constraint.
(4)check constraint.
(5)default constraint.
Is This Answer Correct ?    1 Yes 0 No
Ravi Gupta

Other SQL Server Interview Questions
  Question Asked @ Answers
difference between select column name from table name where serviceid=2; and select max(column name) from table name where serviceid=2; IN ORACLE Wipro 3
Is index a datbase objects in sql server?   2
Where is SQL Srever (In sQL server 2005/2008 where is SQL Server Located). TCS 2
Difference between writing SQL query and stored procedure ? Cognizent 15
how to improve the speed of SQL database server and how to avoid dead lock? TCS 1
select the 3rd maximum salary from sql server database if 4 (just an example In practically I may not know the exact situation) of the highest salaries are equal. TCS 8
default databases available in sql server and there uses ? TCS 3
syntax and example for bitmap index in sql???   1
Diffrence between DTS vs SSIS IBM 2
There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?   1
my problem is tempdb tempdb(dbname) 77752.95 MB(db size) 25345.03 MB (unallocated size) suppose i increased temp db size 10 gb . after increase the temp db showing 87 gb (dbsize) 25346.03MB(unallocated size)--unallocated size is showing same .please clarify.   1
For more SQL Server Interview Questions Click Here 

Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
Copyright 2013  All Rights Reserved.   ::