Filtering Customer Names Using WHERE with LIKE Pattern Matching
📖 Scenario: You work at a small online store. You have a list of customers in a database table. You want to find customers whose names start with certain letters.
🎯 Goal: Build a SQL query that selects customer names from a table called customers where the names match a pattern using the LIKE operator.
📋 What You'll Learn
Create a table called
customers with a column name and insert exact customer names.Create a variable
pattern to hold the pattern string for matching names.Write a SQL
SELECT query that uses WHERE name LIKE pattern to filter customers.Complete the query by adding a semicolon at the end.
💡 Why This Matters
🌍 Real World
Filtering customer or user data by name patterns is common in business reports and search features.
💼 Career
Knowing how to use WHERE with LIKE helps in writing queries for data filtering and reporting in many database jobs.
Progress0 / 4 steps