Magento database management — MySQL optimization, schema design, declarative schema, and database migrations.
You can use INSERT IGNORE INTO mysql query with the help of insertFromSelect() method in Magento 2 with use of magento best standard in your module.