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 (2041)
 SQL Server interview questions  SQL Server Interview Questions (1082)
 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 (54)
 SQL PLSQL interview questions  SQL PLSQL Interview Questions (777)
 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 ?    241 Yes 54 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 ?    109 Yes 35 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 42 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 ?    66 Yes 38 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 19 No
Smita
 
Answer
# 6
. Primary Key Constraint
. Foreign Key Constraint
. Unique Key Constraint
. Check Constraint
 
Is This Answer Correct ?    36 Yes 26 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 22 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 7 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 ?    4 Yes 3 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 ?    2 Yes 1 No
Ravi Gupta
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is the disadvantage of using subquery exact after a select statement?ex. select (select * from sometable)   1
Diffrence between DTS vs SSIS IBM 2
What is one of the first things you would do to increase performance of a query? For example, a boss tells you that ?a query that ran yesterday took 30 seconds, but today it takes 6 minutes? Wipro 2
I am learning Testing, so i want to learn SQL also because SQL is important for Testing. I want to know which is best Institute in Ameerpet or SR Nagar or any other place in Hyd? Please help me.   7
How send email from database?. Merrill-Lynch 2
How to a Query to copy data from on table to another table. Cap-Gemini 4
HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE TCS 17
statement (of account) Receive ID_receive Date_receive Amount_receive TO_receive From_receive Description_receive 1 2010/01/01 500 Bank Ahmed Payment from the account 2 2010/02/01 700 Bank Ahmed Payment from the account Payment ID_payment Date_payment Amount_payment From_payment To_payment Description_payment 1 2010/03/01 1000 Ahmed Sales Sale goods 2 2010/04/01 1500 Ahmed Sales Sale goods How can crate Stored Procedures for the statement (of account) from these tables? I want statement (of account) like this: (in sql 2005) ID_ name description debit account credit account balance   1
Explain basic SQL queries with SELECT from where Order By, Group By-Having? Wipro 3
what is statistics   1
What is the purpose of using COLLATE in a query?   1
How do you implement one-to-one, one-to-many and many-to- many relationships while designing tables? TCS 4
 
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