There are products ( Winner - ID_ticket ):
ID_product Name_product ID_seller Winner
1 iPhone 2 3
2 iPhone 2 4
And tickets to them.
ID_ticket ID_product ID_user
3 1 1
4 1 3
Essence of the question:
- How to change the tables so that the seller has the opportunity to put on sale several copies of the goods, without duplicating the records in the database? When the tickets run out, the
Winnerfield of the product changes to the winner'sID_ticket.