Similar to if / else statements in many programming languages, SQL has the case then statement. Using this statement allows a query to be written dynamically depending on the condition it is checking against.