I need to make a Query that passes all records in the table and update the rate_general column (this column is the average of the rate_food + rate_service + rate_price + rate_environment / 4 notes) of each record, how to do this? are 20,000 records.
Add the average calculation in your update, but if your field is integer type the average will ignore the decimal places, so I'm adding a CAST AS DECIMAL to your average consider field the decimal places.
UPDATE
SET rate_general = CAST((rate_food + rate_service + rate_price + rate_environment) AS DECIMAL(12,2)) / 4
Do not forget to add the WHERE clause if you want to add some filter to update the records.
I do not know if it can help, but there is a function in mysql called avg
, it does the average of your records