SQL SORTING and FILTERING on HR Database: Display the first and last name, and salary for those employees whose first name is ending with the letter m
SQL SORTING and FILTERING on HR Database: Exercise-10 with Solution
10. From the following table, write a SQL query to find those employees whose first name ends with the letter ‘m’. Return the first and last name, and salary.
Sample table : employees
Sample Solution:
SELECT first_name, last_name, salary
FROM employees
WHERE first_name LIKE '%m';
Sample Output:
first_name | last_name | salary ------------+-----------+--------- Adam | Fripp | 8200.00 Payam | Kaufling | 7900.00 William | Smith | 7400.00 William | Gietz | 8300.00 (4 rows)
Relational Algebra Expression:
Relational Algebra Tree:
Practice Online

Query Visualization:
Duration:

Rows:

Cost:

Contribute your code and comments through Disqus.
Previous: From the following table, write a SQL query to find those employees whose salary is in the range 9000,17000 (Begin and end values are included). Return full name, contact details and salary.
Next: From the following table, write a SQL query to find those employees whose salary is not in the range 7000 and 15000 (Begin and end values are included). Sort the result-set in ascending order by the full name (first and last). Return full name and salary.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
SQL: Tips of the Day
MySQL export schema without data
mysqldump -h yourhostnameorIP -u root -p --no-data dbname > schema.sql
Ref: https://bit.ly/3xzB9dS
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework