In MySQL, this query might throw a division by zero error:
SELECT ROUND(noOfBoys / noOfGirls) AS ration
FROM student;
If noOfGirls
Division by NULL actually works in MySQL server and returns NULL. So you can do:
SELECT ROUND(noOfBoys / NULLIF(noOfGirls, 0)) AS ration FROM student;
I think NULL ratio is the most accurate for this case. If you need the ratio to be equal to numOfBoys then you can use:
SELECT COALESCE(ROUND(noOfBoys / NULLIF(noOfGirls, 0)), noOfBoys) AS ration FROM student;