Below query will list the process currently accessing the server database, this will be useful in bug tracking.
show processlist();
show processlist();
SELECT IF( viewers > 100 , 1, 0) AS hotproduct FROM mytable
the condition is like thisIF ( condition here , true , false )