Write a SQL query to fetch names containing 'nee'.

SQL
Easy
TCS
65.8K views

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.

Start Practicing

Related Interview Questions

Browse all 19 SQL questionsBrowse all 79 TCS questions