Informatics Practices
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';
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
2 Likes
Related Questions
If column "Salary" contains the data set {10000,15000,25000,10000,15000}, what will be the output after the execution of the given query?
SELECT SUM(DISTINCT SALARY) FROM EMPLOYEE;- 75000
- 25000
- 10000
- 50000
What SQL statement do we use to find the total number of records present in the table Product?
- SELECT * FROM PRODUCT;
- SELECT COUNT(*) FROM PRODUCT;
- SELECT FIND(*) FROM PRODUCT;
- SELECT SUM() FROM PRODUCT;
Which one of the following is not an aggregate function ?
- ROUND()
- SUM()
- COUNT()
- AVG()
Which of the following functions is used to find the largest value from the given data in MySQL?
- MAX()
- MAXIMUM()
- LARGEST()
- BIG()