Code a SQL statement to change the type to “geeky” for any book that has the word “Computer” or “Networking” in the title
x
UPDATE book
SET type = 'geeky'
WHERE title = %Computer% or %Networking%
The code isn’t right. What can I use in the WHERE clause to choose these two words and type them as geeky?
Advertisement
Answer
Try the following
UPDATE book
SET type = 'geeky'
WHERE title like '%Computer%'
or
title like '%Networking%'