r/DatabaseHelp • u/hdvlprbi • Feb 18 '18
[Help] How to design a "Deal" System?
Hi, I have a website that users can have some deals with each other. when two users register in system. they can transfer money with each other. lets say an example. you register on the website and your friend too. then in system, you make a new "Deal" and pay $ 30 to your web site. your friend come and confirm the deal and send you the object you buy from him / her. so here we have 2 table in database one for users and one for "deals"
my question here is how to design a relationship between these tables? we have two users "row" that are related to one "row" in "deals" table. so every "deal" has two user, and every user can have multiple deals.
One to many or many to many and why? I'm not perfect at database design and I need your help and advice. thank you so much.