What are constraints? Explain different types of constraints
...Constraints enable the RDBMS enforce the integrity of the database automatically, without needing you to create triggers, rule or defaults. Types of constraints: NOT NULL, CHECK, UNIQUE, PRIMARY KEY, FOREIGN KEY.
There are 6 types of Constrains: NOT NULL CHECK UNIQUE PRIMARY KEY FOREIGN KEY DEFAULT = The DEFAULT constraint provides a default value to a column when the INSERT INTO statement does not provide a specific value. For example, if we create a table as below:
There are 6 types of Constrains:
ReplyDeleteNOT NULL
CHECK
UNIQUE
PRIMARY KEY
FOREIGN KEY
DEFAULT = The DEFAULT constraint provides a default value to a column when the INSERT INTO statement does not provide a specific value. For example, if we create a table as below:
CREATE TABLE Student
(
Student_ID int,
Last_Name varchar (30),
First_Name varchar (30),
Score DEFAULT 80
)
Regards,
Lata Negi
CREATE TABLE Student
ReplyDelete(
Student_ID int,
Last_Name varchar (30),
First_Name varchar (30),
Score int DEFAULT 80
)
give the data type of score field......
insert into student(student_id,last_name,first_name) values(1,'sdf','sdfsd')
write this query and solve the problem ...
Thanks and Regards
Subhash Sharma