Answer the question
In order to leave comments, you need to log in
How to design a database schema for “users, tariff. plans, orders?
There are users, there are tariff plans. There are orders, we put the tariff plan in the order. The tariff plan can have different duration - a month, 2, a year, etc.
Also, the order can be paid, unpaid, cancelled...
I'm wondering how can I calculate the user's balance? It - a field balance in the table "user" - is generally necessary? Or is it better to take all the user's orders, take only the paid ones and subtract from them the prices for the tariff plans that this user has bought? Something somehow difficult?
Didn't find anything on google. What is the best way to design all this?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question