Create TRIGGER or PROCEDURE in mysql

Job ID: 30978284

Budget: $2 – $8 USD

I have the following 3 mysql tables

table_availables_dates

id date
1 2021-07-27
2 2021-07-28
3 2021-07-29
4 2021-07-30
5 2021-07-31
....

table_requirement_appointments

id_requirement first_appointment_date quantity_appointments days_between_appointment

1 2021-07-29 6 3

table_appointments

id_appointment date

1 2021-07-29
2 2021-08-02
3 2021-08-05
4 2021-08-08
5 2021-08-11
6 2021-08-14

i need a trigger in table "tablel_requirement_appointments" to insert into table "table_appointments"
records according to "quantity_appointments" and "days_between_appointment".

if some (or all) dates are not available in table_availables_dates insert record with id and empty date



thank you