SQL interview question: UPDATE a Text Value
Relabel the Genre
The catalog team decided 'Hard Rock' should be merged into the 'Metal' genre for playlist curation.
Write a single UPDATE statement changing every artist labeled 'Hard Rock' to 'Metal'.
Note: Your change is verified automatically and rolled back afterwards.
This challenge changes data. Your statement runs on a private copy of the database, then we check the resulting table.
Tables
artists 10 rows
- artist_id integer PK
- name text
- genre text
| artist_id | name | genre |
|---|---|---|
| 1 | The Beatles | Rock |
| 2 | Pink Floyd | Progressive Rock |
| 3 | Michael Jackson | Pop |