For the exercise #7 in the link above, the recommended code under the hint section below,
WHEN medium LIKE ‘%gold%’ THEN ‘Gold’
WHEN medium LIKE ‘%silver%’ THEN ‘Silver’
END AS ‘Bling’,
WHERE Bling IS NOT NULL
GROUP BY 1
ORDER BY 2 DESC;
would yield the following results is derived.
- Silver - 293
- Gold - 41
However, Within the count of 41 under Gold, there exists a record with ‘Gold, silver, platinum, black opals, boulder opals, demantoid garnets, rubies, enamel.’ under the ‘medium’ column, which contains both words Gold and Silver.
I am not quite sure how the above record got “thrown” into the Gold category despite having both Gold and Silver in it. Would anyone be able to shed some light on this?
Thanks in advance!