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
What is the difference between a clustered index and a non-clustered index?
What purpose does the model database server?
Can two tables share a primary key?
How can you set the threshold at which sql server will generate keysets asynchronously?
How do I open port 1433?
How can you tell if a database object is invalid?
What are different types of replication in sql server?
What are the different types of join?
Write an sql query to find first weekday of the month?
How can I create a report based on a query? : sql server management studio
What is Sqlpaging in SqlServer 2005 ?
What is difference between index seek vs. Index scan?
Explain acid?
How to create a user name in a database?
What is pessimistic concurrency?