Do you have knowledge of SQL? Can you write a query to fetch student names with 'nee' as a substring?

SQL
Easy
TCS
67.8K views

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.

Start Practicing

Related Interview Questions

Browse all 19 SQL questionsBrowse all 79 TCS questions