Re: Tables and foreign keys

Amit Tandon <[email protected]>
Newsgroups gmane.comp.php.database
Message-ID <CAM5Pkjcd024M4q0cRo4D9+QDqrndKovXLv2daWW-XVk4WCj+qg@mail.gmail.com>
Dear Karl

Foreign key is a good option (provided you use InnoDB database) to automate
the deletion/updation of cart details when you remove cart.

Besides 1:1 cardinality is good or bad can only be decided on the semantics
of your tables.

As a an aside, if it is 1:1 cardinality, then you can probably merge the
two tables
============
regds
amit

"The difference between fiction and reality? Fiction has to make sense."


On Mon, Dec 26, 2011 at 12:38 PM, Karl DeSaulniers <[email protected]>wrote:

> Hello all,
> I have two database tables. Cart and a cartdetails.
> I want the information for the cartdetails to be based on/autofilled info
> from cart.
> I want the ability to delete from cart and cartdetails to automatically
> clear as well.
> Would a foreign key be best suited for this? What kind of cardnaility
> would I use 1:1 ?
> Hope I make sense.
>
> Hope everyone had a great holidays!
>
> Best,
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.