Imagine a coiffeur, with his services:+----+-----------------+--------+| id |      name       | amount |+----+-----------------+--------+|  1 | hair cut        |     40 ||  2 | shampoo         |     10 ||  3 | french manicure |     90 |+----+-----------------+--------+Imagine a table of transactions:+----+------------+------------------+| id | id_service | date_transaction |+----+------------+------------------+|  1 |          1 | 01/01/2015       ||  2 |          1 | 02/01/2015       ||  3 |          1 | 02/01/2015       ||  4 |          2 | 02/01/2015       ||  5 |          2 | 02/01/2015       ||  6 |          1 | 06/01/2015       ||  7 |          1 | 06/01/2015       ||  8 |          3 | 06/01/2015       ||  9 |          2 | 06/01/2015       || 10 |          2 | 10/01/2015       || 11 |          1 | 10/01/2015       || 12 |          3 | 10/01/2015       || 13 |          1 | 10/01/2015       || 14 |          2 | 10/01/2015       || 15 |          2 | 11/01/2015       || 16 |          1 | 16/01/2015       |+----+------------+------------------+With a simple INNER JOIN we can read, for example, the SUM of a specific day.But our coiffeur is no technology addicted and tomorrow he will change every service.So, to prevent this drama, how I must setup my webapp?1) I repeat service.name and amount.name every time in the table of transactions? So, I don't use the INNER JOIN?1a) I could lose also the possibility to GROUP BY, without numerics ID. And I cannot use them from service table because service change (or, worst) is deleted...2) I need to block the user to edit/delete his service(s)?3) What your consideration?
Do I need use really INNER JOIN?
database design;mysql
The question should not be whether or not you need to use inner joins.The design is flawed. The flaw is that the transaction entity is missing a property, i.e., your transaction table is missing a column to record the amount of the operation. The other flaw is that the amount of a service is really its price.Add an amount column to the transaction table.Rename the amount column in the service table to price.When a transaction is added, you set the amount to the corresponding price value.User should be allowed to change the price of any service at any timeUser should only be allowed to change the name of a service if it has no transactions.Uses should only be allowed to delete a service if it has no transactions.Changes in service prices don't affect the amount of old transactions.