w3resource

Oracle: Display first name, last name and their salary of first 10 employees

Oracle Basic: Exercise-4 with Solution

Write a query to list first name, last name and their salary for first 10 employee contained in the employees table.

Sample table: employees


Sample Solution:

Oracle Code :

 SELECT first_name, last_name, salary 
 FROM employees 
 WHERE ROWNUM < 11;

Output:

SQL> SELECT first_name, last_name, salary FROM employees WHERE ROWNUM < 11;

FIRST_NAME           LAST_NAME                     SALARY
-------------------- ------------------------- ----------
Steven               King                           24000
Neena                Kochhar                        17000
Lex                  De Haan                        17000
Alexander            Hunold                          9000
Bruce                Ernst                           6000
David                Austin                          4800
Valli                Pataballa                       4800
Diana                Lorentz                         4200
Nancy                Greenberg                      12008
Daniel               Faviet                          9000

10 rows selected.

Improve this sample solution and post your code through Disqus.

Previous: Write a query to display first name, last name and their salary of employees where column headings will be specified as aliases: FirstName, LastName and Salary.
Next: Oracle Operator

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/basic/oracle-basic-exercise-4.php