Here is a SQL question you could expect to see in an interview:

There is a table with an active column. It has been discovered that the values have been swapped around and need to be corrected. How would you swap all instances of ‘t’ to ‘f’ and ‘f’ to ‘t’, while leaving the other values untouched? You can only write one SQL statement and cannot use any temporary variables or tables.

How would you go about it? Running a SELECT command on the table yields the results below:

The solution to this problem requires the use of a CASE statement along with the UPDATE command.

After the update, the table would look like this:

Without the CASE statement, the queries would look something like this: