what is Constraint? How many types of constraints in SQL ?
Answer Posted / awadhesh
You can place constraints to limit the type of data that can go into a table. Such constraints can be specified when the table when the table is first created via the CREATE TABLE statement, or after the table is already created via the ALTER TABLE statement.
Common types of constraints include the following:
NOT NULL Constraint: Ensures that a column cannot have NULL value.
DEFAULT Constraint: Provides a default value for a column when none is specified.
UNIQUE Constraint: Ensures that all values in a column are different.
CHECK Constraint: Makes sure that all values in a column satisfy certain criteria.
Primary Key Constraint: Used to uniquely identify a row in the table.
Foreign Key Constraint: Used to ensure referential integrity of the data.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How to write a query with a full outer join in ms sql server?
Do you know what is xpath?
What are xml indexes?
What is mapping schema?
How to run queries with sql server management studio express?
What is cursor in ms sql server?
what are defaults? Is there a column to which a default can't be bound? : Sql server database administration
I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration
Is it true, that there is no difference between a rule and a check constraint?
What are the steps you should follow to start sql server in single-user mode?
What are rest-style architecture's?
Describe how to use linked server?
What is exporting utility?
How can you check the level of fragmentation on a table?
What happens when the SQL Azure database reaches Max Size?