In MySQL, this query might throw a division by zero error:
SELECT ROUND(noOfBoys / noOfGirls) AS ration FROM student;
If noOfGirls
noOfGirls
check if the denominator is zero and the nominator is not NULL - if yes then use 'NaN'.