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

Direct Answer

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…

Common Mistakes to Avoid

  • Using = instead of LIKE
  • Incorrect wildcard placement
  • Forgetting table name
  • Case sensitivity issues

Sound confident on this question in 5 minutes

Answer once and get a 30-second AI critique of your structure, content, and delivery. First attempt is free — no signup needed.

Try it free

Related Interview Questions

Browse all 101 SQL questionsBrowse all 145 TCS questions