I have some doubts about how to propose the structure of a database, the dilema is if I have to store serialized data or it's better to make a table with relational fields.
An example of that is to supose that application:
- Customers have fees to pay
- These fees are generated based on the date of the first payment and the payment deadline
- Imagine an online course of 600 euros and that you define as the date of the first payment 2022-01-01 and payment deadline 2022-03-01, there we would have 3 installments of 200 euros
I am currently proposing a structure in which we have:
- A table "clients"
- A table "courses"
- A table "course_has_inscriptions"
Well, inside the table "course_has_inscriptions", we have the fields:
- id
- course_id
- client_id
- issue_date
- deadline_date
- next_payment
- quotes [I WANT TO SAVE AN ARRAY OF SERIALIZED QUOTAS HERE]
The array looks like this:
$quotas = [];
$quotas ['2022-01'] ['value'] = 200
$quotas ['2022-02'] ['value'] = 200
$quotas ['2022-03'] ['value'] = 200
Are there any advantages if instead of doing so I do it inside another relational table of the type "quotes" where I store:
- id
- inscription_id
- quote
- value
Thank you