The below are some examples of writng a query with the select clause where we can
1) Write a Query to View all columns data from emp table…
Select * from emp; --when ever we say * it means display all the columns from the table
2) Write a Query to View empno,ename,sal columns data from emp table…
3) Write a Query to View employee name and salary columns data from emp table…
4) Write a Query to View employee name and department no data from emp table…
5) Write a Query to View department name and location columns data from dept table…
6) Write a Query to View employee name, commission and salary columns data from emp table…
7) Write a Query to View department number columns data from dept table…
8) Write a Query to View salary,job,employee name details from emp table…
9) Write a Query to View employee no,employee name,department no and also a hardcoded text ‘learn sql’ column details from emp table…
Note: when selecting any column from the table to print we can also select any harcoded text as a column along with them.This harcoded text will repeat for all the records which are being printed from the table….
Dual Table :
Dual is a table which is created by oracle along with the data dictionary.
It consists of exactly one column whose name is dummy and one record.
The value of that record is X.
Select * from dual;
o/p :- X.
purpose of this table is mainly we use for the pseudo columns.
Example : select sysdate from dual;
Sysdate is an oracle provided column which returns date and time….
So, if I need todays date and time we can use the above query which again returns only one row.
Also we can use this table to practice some character or number functions which we will go through
In next sessions….