LIKE is used to search for text patterns. It's extremely common when building basic search features.
• % — represents zero, one, or many characters
• _ — represents exactly one character
Pattern examples
'A%' = text starting with A
'%son' = text ending with son
'%market%' = text containing market
sql
SELECT CustomerName, Country
FROM Customers
WHERE CustomerName LIKE 'A%';You should see
+--------------------+---------+ | CustomerName | Country | +--------------------+---------+ | Alfreds Futterkiste| Germany | | Ana Trujillo | Mexico | | Antonio Moreno | Mexico | | Around the Horn | UK | +--------------------+---------+ What this code does: It finds rows where CustomerName starts with A. Practical version: In a product search, you could use WHERE ProductName LIKE '%phone%' to find products with "phone" in the name.