Re: Primary Keys and Foreign Keys
Date: Sun, 17 Dec 2000 13:31:11 GMT
Message-ID: <91if70$mj9$1_at_nnrp1.deja.com>
joe,
that would have to be the funniest thing i have read since, well, the Claire Swire 'yummy' saga (ok, so it wasn't that long ago). congrats on a true industry legend taking time out to assist us mortals.
just one note on your tables. when you have time could you manage to insert these values (Dale Kerr, Ashley Judd), (Dale Kerr, Jennifer Love Hewitt), and (Dale Kerr, Elizabeth Hurley) ???
dale kerr
melbourne, australia
[snippet]
In article <91dqaj$cn8$1_at_nnrp1.deja.com>,
Joe Celko <71062.1056_at_compuserve.com> wrote:
> CREATE TABLE Orgy
> (boy_name INTEGER NOT NULL
> REFERENCES Boys (boy_name),
> girl_name INTEGER NOT NULL,
> REFERENCES Girls(girl_name),
> PRIMARY KEY (boy_name, girl_name)); -- compound key
>
> CREATE TABLE Playboys
> (boy_name INTEGER NOT NULL
> REFERENCES Boys (boy_name),
> girl_name INTEGER NOT NULL UNIQUE, -- nested key
> REFERENCES Girls(girl_name),
> PRIMARY KEY (boy_name, girl_name)); -- compound key
>
> CREATE TABLE Playgirls
> (boy_name INTEGER NOT NULL UNIQUE -- nested key
> REFERENCES Boys (boy_name),
> girl_name INTEGER NOT NULL,
> REFERENCES Girls(girl_name),
> PRIMARY KEY (boy_name, girl_name)); -- compound key
>
> CREATE TABLE Couples
> (boy_name INTEGER NOT NULL UNIQUE -- nested key
> REFERENCES Boys (boy_name),
> girl_name INTEGER NOT NULL UNIQUE -- nested key,
> REFERENCES Girls(girl_name),
> PRIMARY KEY(boy_name, girl_name)); -- compound key
Sent via Deja.com
http://www.deja.com/
Received on Sun Dec 17 2000 - 14:31:11 CET