create a related row if no related row exists I have two mysql tables with a one-to-many relationship.

I want to find all rows in the 'one' table which do not have a row in the 'many' table and add a single row in the 'many' table for each one.

How can I edit my query to achieve this?

INSERT INTO many_table SET 
    id = ( SELECT id 
           FROM one_table 
           JOIN many_table ON one_table.id = many_table.related_id 
           WHERE many_table.related_id is null
         ) 
    name = 'george'
Not sure what is name = 'george' is doing but assume it's part of the filtering in WHERE clause.

INSERT INTO many_table (id, name)
SELECT o.id, o.name
FROM one_table o
LEFT JOIN many_table m ON m.related_id = o.id
WHERE o.name = 'george' AND m.id IS NULL