SQL Practice

CASE expressions

Return conditional values.

  1. 01Classify patient height

    Return each patient id and label height as short (<160), average (160–180), or tall (>180).

    hard
  2. 02Salary bands

    Label each doctor salary as Under 160k, 160k to 189999, or 190k and above.

    hard
  3. 03Admission length category

    Return each admission id and label it as Open when discharge_date is NULL, otherwise Closed.

    hard
← All practice topics