Conditions

There are conditional commands for MySQL too. IF/ELSE

Or cascaded: