Top "Check-constraints" questions

CHECK constraints enforce domain integrity by limiting the values that are accepted by one or more columns.

The values of one column cannot be greater than another

I am trying to create a table where the values in one column can't be greater than the next column …

sql-server database-design constraints check-constraints
Oracle: how to formulate a complex constraint with case when

The following conditional constraint simply doesn't work. Is it possible to formulate in a working way? ALTER TABLE eni_trasc_…

oracle check-constraints
Using a case statement in a check constraint

i'v been learning SQL for the last week but I am unsure how to correctly add a case statement within …

sql oracle oracle11g check-constraints
How do I have a check constraint that refers to another table?

I have the following tables in a SQL Server 2008 db: tblItem, which has an ItemID field; tblGoodItem, which also has …

sql sql-server tsql sql-server-2008 check-constraints
How to reference other tables in check constraints?

I have a table, ProductSupportArticles: ProductSupportArticleID int NOT NULL <primary key> ParentArticleID int NULL ProductID int NOT NULL …

sql-server referential-integrity check-constraints
What SQL databases support subqueries in CHECK constraints?

What SQL databases, if any, support subqueries in CHECK constraints? At present and as far as I know, Oracle, MySQL, …

sql subquery check-constraints
PostgreSQL check constraint for foreign key condition

I have a table of users eg: create table "user" ( id serial primary key, name text not null, superuser boolean …

sql postgresql foreign-keys check-constraints
Hibernate Check Annotation

I have a table with three fields, say a, b, c. I would like to add a constraint ensuring that …

java sql hibernate jpa check-constraints
Using a check contraint in MySQL for controlling string length

I'm tumbled with a problem! I've set up my first check constraint using MySQL, but unfortunately I'm having a problem. …

mysql check-constraints
How to create a check constraint between two columns in SQL?

I am trying to create a Basic pay (BP) table with CREATE TABLE bp ( bpid VARCHAR(5), FOREIGN KEY (bpid) REFERENCES …

oracle check-constraints