I have two tables:
T1(A,B) where
create table T1( A char(2) NOT NULL primary key check(T1.A not in T2.B), B char(2) unique );

T2(C,B) where
create table T2( C number(2) primary key, B char(2) unique references T1 check(T1.B not in T1.A) );

Here, T2.B references T1.A.

My question is that how can I put a check constraint to T1.A and T1.B such that values allowed by T1.A are different from those allowed by T2.B?

有帮助吗?

解决方案

The knapsack problem in worst case needs to verify all the subsets of the given knapsack to determine the best combination to put in knapsack hence its worst case performance using backtracking which essentially evaluates all valid combinations is O(2^n) which are no of subsets of given set of n items. Hence it has exponential time complexity.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top