KnowledgeBoat Logo
|

Informatics Practices

What SQL statement do we use to display the record of all students whose last name contains 5 letters ending with "A"?

  1. SELECT * FROM STUDENTS WHERE LNAME LIKE '_ _ _ _A';
  2. SELECT * FROM STUDENTS WHERE LNAME LIKE '_ _ _ _';
  3. SELECT * FROM STUDENTS WHERE LNAME LIKE '????A';
  4. SELECT * FROM STUDENTS WHERE LNAME LIKE '*A';

SQL Queries

1 Like

Answer

SELECT * FROM STUDENTS WHERE LNAME LIKE '_ _ _ _A';

Reason — The SQL statement to display the records of all students whose last name contains 5 letters ending with "A" is SELECT * FROM STUDENTS WHERE LNAME LIKE '_ _ _ _A';. This statement uses the LIKE operator with the pattern '_ _ _ _A', where each underscore represents a single character and the letter "A" specifies the ending condition. This pattern ensures that the last name has exactly 5 letters and ends with "A".

Answered By

3 Likes


Related Questions