Hello,

I'll try to explain correctly my idea.

I need to develop a on-line sale's website. For that, I have some dough's on how to 
create the table "basket".

Client

 - IDclie (PK)
 - ...

Produts

 - IDprod (PK)
 - ...

Basket

 - IDbask (PK)
 - IDprod (FK)
 - IDClie (FK)
 - qt
 - date

Sale

 - IDsale (PK)
 - idbask (FK) -> there should only be one ID per basket...in this case.
 - shipping_debit
 - ...

I dont know how to make a propper relation when it comes to (Client - Basket), because 
I wanted to know how many sales a client made.

I was thinking on making an extra table by removing IDclie from Basket and making this:

Clie/Basket
 
 - IDclie (PK)
 - IDbask (PK)

But I can't really add any values due to foreign key constraints.

Any help on how to resolve my problem? How should I solve this?


Thanks

 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to