# CASE ## Definition(s) ### Context: [[Nexus - Google Analytics Certificate Course#4.4 Google Analytics - 4 Process Module 4 - Verify and report on cleaning results|Google Analytics Certificate]] #### Sub-context: [[SQL keywords]] >[! Definition] >SA SQL statement that returns records that meet conditions by including an if/then statement in a query ## Examples ```SQL SELECT Customer_id, CASE WHEN first_name = 'Tnoy' THEN 'Tony' ELSE first_name END AS cleaned_name FROM project-id.customer_data.customer_name ``` ## Related [[SQL keywords]] ## Resources [W3 School's CASE training](https://www.w3schools.com/sql/sql_case.asp) ## Flashcards The below code are generated for use with [Spaced Repetition plugin](https://github.com/st3v3nmw/obsidian-spaced-repetition/) [docs](https://www.stephenmwangi.com/obsidian-spaced-repetition/) A SQL statement that returns records that meet conditions by including an if/then statement in a query @@@ [[CASE]]