Check out example codes for "mysql error 1452". It will help you in understanding the concepts better.

Code Example 1

SELECT child_table.* 
FROM child_table 
LEFT JOIN parent_table 
  ON parent_table.referenced_column = child_table.referencing_column 
WHERE parent_table.referenced_column IS NULL


-- Delete all data from output of that query

Learn ReactJs, React Native from akashmittal.com