https://www.techonthenet.com/mariadb/functions/case.php
This MariaDB tutorial explains how to use the MariaDB CASE function with syntax and examples. The MariaDB CASE function has the functionality of an IF-THEN-ELSE statement by allowing you to evaluate c