J
J
Jedi2018-10-05 14:37:18
MySQL
Jedi, 2018-10-05 14:37:18

How to properly structure a database?

Good afternoon.
Online course website. How to correctly implement the structure of the database?
User (user):

id,
name,
email,
password
created_at,
updated_at

The user after registration can get a "trial version" (trial) for 7 days.
After the end of the trial period, you will have to buy one of the tariff plans.
How to implement all this correctly? Where to record trial, payments, tariff plans?
I will be glad to have a detailed answer from you!)
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-10-05
@PHPjedi

why write it down where? You have created_at, so 7 days trial is a matter of mathematics, and not a separate column in the database
tariff plans and payments will obviously be in the corresponding tariff and payment tables, and there will probably be tables that implement many to many relationships of the
payment_id type | user_id
The current tariff can also be calculated, not stored (not always, here you need to look at the business model)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question