CBSE Class 12 Informatics Practices
Question 37 of 79
Database Query using SQL — Question 8
Back to all questions 8
Question What SQL statement do we use to display the record of all students whose last name contains 5 letters ending with "A"?
- SELECT * FROM STUDENTS WHERE LNAME LIKE '_ _ _ _A';
- SELECT * FROM STUDENTS WHERE LNAME LIKE '_ _ _ _';
- SELECT * FROM STUDENTS WHERE LNAME LIKE '????A';
- SELECT * FROM STUDENTS WHERE LNAME LIKE '*A';
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".