'Create "div_by_ten" a boolean columns based on condition in mysql

Consider a table consisting the marks of students in a mathematics test along with their unique student_id. Write a query to determine which students got the marks that is divisible by 10 and which students did not. Make sure that the output is ordered by student_id.

enter image description here



Solution 1:[1]

select *, case when mod(marks,10) = 0 then 'yes' else 'no' end as 'div_by_ten' from marks order by student_id;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kundan kaushik