Inserting many rows in to a relation table in case these rows are not exist before in the table and also check if the foreign key exists in the main table. This can be done in two ways, coding or sql command.
Which is better, of course sql command is better since we are combining select with insert with where conditions in a one command I will share with you a small section I faced before when doing a big mobile…