What is check constraint?

Answers were Sorted based on User's Feedback



What is check constraint?..

Answer / rajeev

The CHECK constraint is used to limit the value range that
can be placed in a column.

If you define a CHECK constraint on a single column it
allows only certain values for this column.

If you define a CHECK constraint on a table it can limit the
values in certain columns based on values in other columns
in the row.

Is This Answer Correct ?    2 Yes 1 No

What is check constraint?..

Answer / arihant

example of check constraint

CREATE TABLE Customer_Details(
Cust_ID Number(5) CONSTRAINT Nnull1 NOT NULL
CONSTRAINT Ccheck1 CHECK( Cust_ID BETWEEN 101 AND 105),
Cust_Last_Name VarChar2(20) CONSTRAINT Nnull2 NOT NULL,
Cust_Mid_Name VarChar2(4),
Cust_First_Name VarChar2(20),
Account_No Number(5) CONSTRAINT Pkey1 PRIMARY KEY,
Account_Type VarChar2(10) CONSTRAINT Nnull3 NOT NULL,
Bank_Branch VarChar2(25) CONSTRAINT Nnull4 NOT NULL,
Cust_Email VarChar2(30)
);

Is This Answer Correct ?    1 Yes 0 No

What is check constraint?..

Answer / shaik

Check Constraint defines a condition that each row must satisfy.

create table emp(empid number,ename varchar2(15),salary
number,deptid number constraint emp_salary_min
CHECK(sALARY>1000));

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More MySQL Interview Questions

How is data stored in mysql?

1 Answers  


What are the advantages of stored procedures, triggers, indexes?

5 Answers  


What happens if you no create privilege in a database?

1 Answers  


How many rows can be inserted in mysql at a time?

1 Answers  


Is mysql is a programming language?

1 Answers  


What is difference between mysql mysqli and pdo?

1 Answers  


Can you tell the difference between mysql_connect and mysql_pconnect? : Mysql dba

1 Answers  


How can you retrieve a particular number of records from a table?

1 Answers  


How do you connect MySQL database with PHP?

1 Answers  


How many services is running in sql server?

3 Answers   ACC, V2 Solutions,


What is mysql server used for?

1 Answers  


How many tables will create when we create table, what are they?

5 Answers  


Categories