In MySQL, this query might throw a division by zero error:
SELECT ROUND(noOfBoys / noOfGirls) AS ration FROM student;
If noOfGirls
noOfGirls
select case student.noOfGirls when 0 then 1 else round(noOfBoys/noOfGirls) end as ration from `student`