Subject Re: going beyond FOREIGN KEY ... REFERENCES
Author duilio_fos
Lucas,

>What you want to do can perfectly be done with foreign keys

mmm...

>you add a STAR table above your SYSTEM table, like:

could you please expand on this ?

I am afraid I didn't understand.

We start with this database:

create table Stars (
Star_ID integer not null,
System_ID integer,
primary key (Star_ID)
)

create table Systems (
System_ID integer not null,
Planet_ID integer not null,
primary key (System_ID,Planet_ID)
)

Are you suggesting to insert a 3th table btw Stars and Systems ?

Please write the code of the new database.

Thank you

Duilio