I have some information that I am downloading via API into a SQL database. I am setting up cron to do this in the middle of the night. Sometimes new products are added or old ones are edited. I need to add new ones and update old ones if they exist. I am pretty sure it looks something like:
If (id exists){
update product
}else{
insert product
Is this the best way? What about just dropping then re-constructing it?