Write a SQL query to fetch names containing 'nee'.
A practical SQL coding question testing string manipulation and pattern matching capabilities.
Why Interviewers Ask This
Data retrieval is a daily task for developers. This checks if you know how to filter data using wildcards and substring patterns efficiently.
How to Answer This Question
Use the SELECT statement with a WHERE clause. Apply the LIKE operator with wildcards (%) to find the substring anywhere in the name. Ensure correct syntax for the specific SQL dialect being tested.
Key Points to Cover
- SELECT statement
- LIKE operator
- Wildcard usage
- Substring search
Sample Answer
SELECT name FROM students WHERE name LIKE '%nee%'; This query selects the name column from the students table where the name contains the substring 'nee' anywhere in the string. The percent signs act as wildcards for any preceding or following characters.
Common Mistakes to Avoid
- Using = instead of LIKE
- Missing wildcards
- Case sensitivity issues
Practice This Question with AI
Answer this question orally or via text and get instant AI-powered feedback on your response quality, structure, and delivery.
Related Interview Questions
What is the difference between LIKE and equals operators in SQL?
Easy
TCSWhat is the difference between DELETE and TRUNCATE commands in SQL?
Easy
FlipkartWhat is ER model in the DBMS?
Medium
FlipkartWhat is database normalization and why is it important?
Medium
FlipkartWhat are your hobbies and how do they benefit you?
Easy
TCSHow can improve company products through customer feedback?
Medium
TCS