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 (2038)
 SQL Server interview questions  SQL Server Interview Questions (1078)
 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 is Constraint? How many types of constraints in SQL ?
 Question Submitted By :: SQL-Server
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
Constraint are the rules enforced on data columns on table.

Five type of constraints
Primary key
Unique Key
Foreign Key
Not Null
Check
 
Is This Answer Correct ?    330 Yes 56 No
Mudit
 
Answer
# 2
Constraints are used to limit the type of data that can go
into a table.

NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY
CHECK
DEFAULT
 
Is This Answer Correct ?    220 Yes 29 No
Scornguy
 
 
 
Answer
# 3
Constraint are the rules enforced on data columns on table

types of constraints:

PRIMARYKEY
FOREIGN KEY
NOT NULL
UNIQUE KEY
CHECK
DEFAULT
Check
 
Is This Answer Correct ?    108 Yes 32 No
Kumari
 
Answer
# 4
Constraints are used to limit the type of data that can go
into a table.
two basic types of constraints are there
1.column level
2.table level
the difference is that column level constraints are apply
only to one column where as table level constraints are
apply to whole table
Constraints are declare at the time of table creation using
CREATE TABLE command

there are 6 constraints used in oracle
1.NOT NULL
2.UNIQUE
3.PRIMARY KEY
4.CHECK
5.DEFAULT
6.REFERENCES
 
Is This Answer Correct ?    92 Yes 23 No
Bimaleswar Patel
 
Answer
# 5
constraints are the rules enforced on data columns on a
table
use:constraints are used to limit the type of data that
can go in to a table

there are some constraints
a primarykey constraint
a unquekey constraint
a foreinkey constraint
a check constraint
a not null constraint
a default constraint
 
Is This Answer Correct ?    47 Yes 13 No
Yashwanth
 
Answer
# 6
constraint is a mechanism it is used to prevent the invalid
data entry in to the table is called constraint
 
Is This Answer Correct ?    42 Yes 9 No
Bose
 
Answer
# 7
Constraint are used to table columns validations.
there are some constraints.

Primary key,
Foreign Key,
Not Null,
Check,
Unique Key,
default
 
Is This Answer Correct ?    42 Yes 10 No
Shankar K
 
Answer
# 8
Constraints are rool of data integrity.

Types of Constraints are:
1)Not Null
2)Unique
3)Primary Key
4)Check
5)References.
 
Is This Answer Correct ?    38 Yes 11 No
Vijaya
 
Answer
# 9
Constraint are the rules enforced on data columns on table



Five type of constraints
Primary key
Unique Key
Foreign Key
Not Null
Check
 
Is This Answer Correct ?    27 Yes 14 No
Srinivas
 
Answer
# 10
There are a number of different ways to implement
constraints, but each of them falls into one of these three
categories:
Entity constraints,
Domain constraints,
Referential integrity constraints.

Domain Constraints: A Domain constraint deals with one or
more columns. It is important to ensure that a particular
column or a set of columns meets particular criteria. When
you insert or update a row, the constraint is applied
without respect to any other row in the table. The focus is
on the data that is in the column. These kinds of
constraints will resurface when we deal with Check
constraints, Default constraints and rules and defaults.

Entity Constraints: Entity constraints are all about
individual rows. This constraint ignores the column as a
whole and focuses on a particular row. This can be best
exemplified by a constraint that requires every row to have
a unique value for a column or a combination of columns.
This is to ensure that for a particular row, the same value
does not already exist in some other row. We’ll see this
kind of constraint in dealing with Primary key and Unique
constraints.

Referential Integrity Constraints: Referential integrity
constraints are created when a value in one column must
match the value in another column. It can either be in the
same table or more typically, a different table. For
example, we are taking orders for a product, and we accept
credit payment. But we will accept only a few standard
credit card companies like Visa, MasterCard, Discover, and
American Express. Referential integrity constraints allow
us to build what we would call a domain table. A domain
table is table whose sole purpose is to provide a limited
list of acceptable values. In our case we have a CreditCard
table with CreditCardID, and CreditCard as fields. We can
then build one or more tables that reference the
CreditCardID column of our domain table. With referential
integrity, any table that is defined as referencing our
CreditCard table will have to have a column that matches up
to the CreditCardID column of our CreditCard table. For
each row we insert into the referencing table, it will have
a value that is in our domain list. We will see more of
this when we learn about Foreign key constraints.
 
Is This Answer Correct ?    10 Yes 0 No
Jayhar
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
How can you get @@error and @@rowcount at the same time?   8
What is the use of Port no? Wipro 1
please tell me the query to get details of the employee having the second largest salary 247Customer 11
i need some interview questions on sql server developer plz any onee send some links.   2
Can store procedure call by user define function in SQL server? HCL 10
About DTS usage ? Cognizent 2
How will u get 5 years back record?   5
Explain basic SQL queries with SELECT from where Order By, Group By-Having? Wipro 3
How do we get current date in SQL Server 2000, Oracle, MS Access?   13
Write a query to delete duplicate records in SQL SERVER Infosys 36
what is normalization? what is denormalization? Satyam 9
what is call by value & call by reference ? Cap-Gemini 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