What are constraints? Explain different types of
constraints?

Answers were Sorted based on User's Feedback



What are constraints? Explain different types of constraints?..

Answer / haritha

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 ?    283 Yes 70 No

What are constraints? Explain different types of constraints?..

Answer / satyanarayana

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 ?    136 Yes 41 No

What are constraints? Explain different types of constraints?..

Answer / haritha

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 ?    101 Yes 47 No

What are constraints? Explain different types of constraints?..

Answer / hari

Constraint : To Restrict the voilation of irrelegular data
and maintain data integrity.

Primary key
Unique Key
NotNull
Forigen Key
Check

Is This Answer Correct ?    73 Yes 45 No

What are constraints? Explain different types of constraints?..

Answer / smita

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 ?    44 Yes 23 No

What are constraints? Explain different types of constraints?..

Answer / manish nagar

Constraints are used to limit the type of data that can go
into a table.

Constraints can be specified when a table is created (with
the CREATE TABLE statement) or after the table is created
(with the ALTER TABLE statement).

NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY
CHECK
DEFAULT

Is This Answer Correct ?    12 Yes 1 No

What are constraints? Explain different types of constraints?..

Answer / mangesh

. Primary Key Constraint
. Foreign Key Constraint
. Unique Key Constraint
. Check Constraint

Is This Answer Correct ?    38 Yes 32 No

What are constraints? Explain different types of constraints?..

Answer / rahul shrivastava

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 ?    10 Yes 4 No

What are constraints? Explain different types of constraints?..

Answer / ravi gupta

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 ?    4 Yes 2 No

What are constraints? Explain different types of constraints?..

Answer / kannan g

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 10 No

Post New Answer

More SQL Server Interview Questions

Do you know what are acid properties of transaction?

0 Answers  


Explain in brief how sql server enhances scalability of the database system?

0 Answers  


How to know whether our backup is succesfully taken?

1 Answers  


What are the two authentication modes in sql server?

0 Answers  


Which Model uses the SET concept

0 Answers   Infosys,






Explain user defined views?

0 Answers  


Does a server store data?

0 Answers  


Difference between sql server 2000 and sql server 2005?

11 Answers   Aditi Tech, eInfochips, GE, HCL, IBM, Masim Infotech, NIIT, Satyam, Systems Domain,


What is nolock hint in sql server 2008

0 Answers   HCL,


What is the difference between dropping a database and taking a database offline?

0 Answers  


Do you know the capabilities of cursors?

0 Answers  


What keyword you will use to get schema appended to the result set of a ‘for xml’ query?

0 Answers  


Categories