Do you have knowledge of SQL? Can you write a query to fetch student names with 'nee' as a substring?
A practical SQL coding question to assess database querying skills and pattern matching.
Why Interviewers Ask This
Data retrieval is a daily task for developers. This question tests your ability to write basic queries and use string manipulation functions. It confirms you can interact with databases to extract specific information efficiently.
How to Answer This Question
State the table name assumption clearly. Use the SELECT statement with the appropriate column. Apply the LIKE operator with wildcards (%) to match the substring 'nee'. Ensure the syntax is correct for standard SQL.
Key Points to Cover
- SELECT statement syntax
- LIKE operator usage
- Wildcard placement
- Column selection
Sample Answer
Yes, I have experience with SQL. To fetch names containing 'nee', I would use the following query: SELECT name FROM students WHERE name LIKE '%nee%'; The percent signs act as wildcards, allowing any characters before or after 'nee'. This ensures we capture names like 'Anne' or 'Neeha'. If case sensitivity matters, I might use UPPER() function depending on the database system.
Common Mistakes to Avoid
- Using = instead of LIKE
- Incorrect wildcard placement
- Forgetting table name
- 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