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 optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?
What is the difference between executequery () and executeupdate ()?
What is set nocount on?
How do I uninstall sql server 2014?
How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?
What are the general features of sql server management studio? : sql server management studio
What does Master database contains?
How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?
How to connect Azure federated root database and apply federation in entity framework?
Which tcp/ip port does sql server run on? How can it be changed?
What is the contrast between sql and mysql?
What stored procedure can you use to display the current processes?
Do you know sql server 2008 backup compression?
Can we perform backup restore operation on tempdb? : sql server database administration
Define cross join in sql server joins?