The CASE statement chooses from a sequence of conditions and executes a corresponding statement. The CASE statement is SQL’s way of handling if/then logic. The CASE statement is followed by at least one set of WHEN and THEN statements and it must end with the END statement. The ELSE statement is optional, and provides a way to capture values not specified in the WHEN/THEN statements. Example: Supposing I want to know all …