Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stuck on designing the right constraint

0 views
Skip to first unread message

robert

unread,
Nov 23, 2006, 8:45:28 AM11/23/06
to
With the following tables:

create table A (ticker varchar(255), more_data varchar(255), primary
key (A_ID)) type=InnoDB;
create table B (more_data varchar(255), primary key (B_ID))
type=InnoDB;
create table C (A_ID bigint not null, B_ID bigint not null, more_data
varchar(255), primary key (C_ID)) type=InnoDB;

I have a requirement that for table C, the combination of A.ticker and
B_ID must be unique. I've struggled to come up with a ticker table and
a few other ideas, ie (A ... unique ([b_id], [ticker_id]) , but that
doesn't seem right as ticker_id would need to be in both A and C.
Nothing seems right. Any ideas?

Robert

0 new messages