What is check constraint?
Answers were Sorted based on User's Feedback
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 |
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 are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?
Is mysql easy to learn?
What is ddl, dml, and dcl?
Is mysql a backend?
Is mysql server free?
What is DDL in MySQL?
What are slow queries?
What is mysql community edition?
What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?
how to find 2nd highest salary in random database salary of employer.....
Query to select passwords from a table having a column "Password" Whose length is b/w 8 &15 and having 'A' as the first character in the password irrespective of case.
Is mysql a nosql database?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)