w3resource

Oracle: Display all columns of employees table

Oracle Basic: Exercise-2 with Solution

Write a query to display all the columns of employees table.

Note: To display all the columns for a particular table, you can use the asterisk (*) wildcard character as the SELECT list instead of typing the name of every column.
The result set displays the columns in the order in which they are defined in the table.

Sample table: employees


Sample Solution:

Oracle Code :

SELECT *
  FROM employee;

Output:

SQL> SELECT *
  2  From employees;

EMPLOYEE_ID FIRST_NAME   LAST_NAME   EMAIL       PHONE_NUMBER HIRE_DATE  JOB_ID   SALARY   COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- ------------ ----------  ----------- ------------ ---------- -------  -------- -------------- ---------- -------------

     100    Steven       King        SKING       515.123.4567 17-JUN-03  AD_PRES  24000                                  90
                                         
     101    Neena        Kochhar     NKOCHHAR    515.123.4568 21-SEP-05  AD_VP    17000                   100            90                                     
                                       
.....

107 rows selected.

Pictorial Presentation:

Pictorial: Display all columns of employees table

Improve this sample solution and post your code through Disqus.

Previous: Write a query to list first name, last name and their salary for employee contained in the employees table.
Next: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.

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-2.php