In MySQL, this query might throw a division by zero error:
SELECT ROUND(noOfBoys / noOfGirls) AS ration FROM student;
If noOfGirls
noOfGirls
Yes, you can do a case:
select case when noOfGirls=0 then noOfBoys else round(noOfBoys/noOfGirls) end as ration from student;
But you probably want:
select case when noOfGirls=0 then 1 else round(noOfBoys/noOfGirls) end as ration from student;