The SQL query you provided is almost correct, but it will only return results where the Description
is exactly equal to 'Signed'. If you want to find any works of art that contain the word 'Signed' in their description, you should use the LIKE
operator instead. Here’s the corrected version of your query:
SELECT W.Title, W.Description, A.FirstName, A.LastName
FROM tutorials.WORK W
JOIN tutorials.ARTIST A ON W.ArtistID = A.ArtistID
WHERE W.Description LIKE '%Signed%';
In this query:
LIKE
operator is used with %
wildcards to match any description that contains the word 'Signed' anywhere in the text.WORK
and ARTIST
tables based on the ArtistID
.This will give you all works of art that have 'Signed' in their description, regardless of its position in the text.