ALLInterview.com :: 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                      
Google
   
 
Categories >> Software >> Databases >> SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions (2040)
 SQL Server interview questions  SQL Server Interview Questions (1079)
 MS Access interview questions  MS Access Interview Questions (25)
 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 (775)
 Databases AllOther interview questions  Databases AllOther Interview Questions (107)
Question
What are constraints? Explain different types of 
constraints?
 Question Submitted By :: SQL-Server
I also faced this Question!!     Answer Posted By  
 
Answer
# 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
value.
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 ?    239 Yes 52 No
Haritha
 
Answer
# 2
Constraints are the constraints which can provide on the
column data.The types of constraints are
1).Domain Integrity constraints
EX:Check
2).Entity Integrity constraints
Ex:Unique,Primary key
3).Referential Integrity constraints
EX:Foreignkey
 
Is This Answer Correct ?    108 Yes 34 No
Satyanarayana
 
 
 
Answer
# 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 40 No
Haritha
 
Answer
# 4
Constraint : To Restrict the voilation of irrelegular data
and maintain data integrity.

Primary key
Unique Key
NotNull
Forigen Key
Check
 
Is This Answer Correct ?    65 Yes 37 No
Hari
 
Answer
# 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
Smita
 
Answer
# 6
. Primary Key Constraint
. Foreign Key Constraint
. Unique Key Constraint
. Check Constraint
 
Is This Answer Correct ?    36 Yes 25 No
Mangesh
 
Answer
# 7
3 basic types
1.entity constraint:
check
not null
null
2.domain constraint:
unique
primary
composite primary key
3.referential constraint:
integrity
foreign
 
Is This Answer Correct ?    26 Yes 21 No
Rev
 
Answer
# 8
Constraints are used to restrict or protect the data and
accessing from the table
There are 5 types of constraints available,
That,
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
Value.
4.Check Constratints
5.Not null
 
Is This Answer Correct ?    10 Yes 5 No
Kannan G
 
Answer
# 9
Constraints enable the RDBMS enforce the integrity of the
database automatically, without needing you to create
triggers, rule or defaults.

Types of constraints:
PRIMARY KEY
UNIQUE
FOREIGN KEY
CHECK
NOT NULL

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
 
Answer
# 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
 
One table Test with single column. These are the values in the table a b c d e f g h I need a query (without using any variable) with output as - a b c d f f g h   1
There is a table1 with records (1,2,3,4,5,6) and table2 with records (4,5,6,7,8,9).write a query so as to get the result as 1,2,3,4,5,6,7,8,9 RBS 12
select empid empname from employee What is the result for the about query?   4
write down the sql query? Table Name : emp1 empid empname 1 bala 2 guna Table Name : emp2 empid empname 1 <Null> 2 <Null> Solution : emp1 names are updated in emp2, write a query?   8
what is the disadvantage of SQL Loder? TCS 1
I have to display ten columns values from diffrent ten tables. how many joins are require? HCL 9
hi i am having .mdf file and .ldf file ..how can i get the all table in my .mdf..plz give solution   2
One table how may column and Primary key   3
could you please reply for these question: 1.About Use Apply? 2.Avoid cursors - When we have a situation that we can not avoid the use of cursor than what is the alternate solution? is there anything we can use instead of cursor to perform the desired task? which optiomize the peroformance too. 3.What is computed columns? Thanks in advance. Regards, Rupesh   3
Explain different isolation levels?   4
What is the difference between views and stored procedures? Can we have input parameters for views?   5
What are all new concepts in SQL Server 2008? That is Exactly Difference between 2005 to 2008 IBM 2
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 


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

ALLInterview.com   ::  KalAajKal.com