Use SAFE_DIVIDE to handle division by zero.

π™Žπ˜Όπ™π™€_π˜Ώπ™„π™‘π™„π˜Ώπ™€ divides two numbers while handling the case where the denominator is zero.

πŸ“Œ Here's the syntax.
πš‚π™΄π™»π™΄π™²πšƒ πš‚π™°π™΅π™΄_π™³π™Έπš…π™Έπ™³π™΄(πš—πšžπš–πšŽπš›πšŠπšπš˜πš›, πšπšŽπš—πš˜πš–πš’πš—πšŠπšπš˜πš›) π™΅πšπ™Ύπ™Ό πš—πšžπš–πš‹πšŽπš›πšœ

If the denominator is zero for any row, it returns NULL instead of causing your query to fail.

π™Žπ˜Όπ™π™€_π˜Ώπ™„π™‘π™„π˜Ώπ™€ is not part of the standard SQL language, but it is often included as a custom function.

If your SQL database does not include the SAFE_DIVIDE function, you can use the CASE statement to handle division by zero. Example below!