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:
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?
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics