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 filter index?
Can a table have 2 primary keys?
How to create view in stored procedure sql server?
How to add the custom code in Report?
What is Command line parameters in PLSQL.?
How many types of objects are there?
What is mean by candidate key?
What is an execution plan? When would you use it?
What are the different types of indexes?
How to define output parameters in stored procedures?
What are indexes in sql?
What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?
How does clustered and non clustered index work?
How to download and install the scaled-down database adventureworkslt?
How to create a user to access a database in ms sql server using "create user" statements?