w3resource

Oracle: List the names, salary of those employees whose salary is four digit number ending with Zero

Oracle Wildcard special Operator: Exercise-9 with Solution

Write a query to list the names (first and last), salary of those employees whose salary is four digit number ending with Zero.

Sample table: employees


Sample Solution:

Oracle Code:

SELECT  first_name, last_name, salary 
FROM employees 
WHERE length (salary) = 4 and salary like ’%0’;

Output:


FIRST_NAME           LAST_NAME                     SALARY
-------------------- ------------------------- ----------
Alexander            Hunold                          9000
Bruce                Ernst                           6000
David                Austin                          4800
Valli                Pataballa                       4800
Diana                Lorentz                         4200
Daniel               Faviet                          9000
John                 Chen                            8200
Ismael               Sciarra                         7700
Jose Manuel          Urman                           7800
Luis                 Popp                            6900
Alexander            Khoo                            3100

........

88 rows selected.

Pictorial Presentation:

Pictorial: List the names, salary of those employees whose salary  is four digit number ending with Zero

Improve this sample solution and post your code through Disqus.

Previous: Write a query to list the names (first and last), hire date of those employees who joined in the month of which second character is 'u'.
Next: Write a query to list the names (first and last), salary of those employees whose names having a character set ’ll’ together.

What is the difficulty level of this exercise?



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/oracle-exercises/wildcard-special-operators/oracle-wildcard-special-operators-exercise-9.php