Out of stock codes {to prevent selling when no stock quantity}

Please help me with the code to import via SQL to block sale if no quantity in stock i tried to follow the forum to no avail i will be very thankful

Hi am trying to solve the same problem here someone should help…