0% found this document useful (0 votes)
31 views

SQL Pratice

Uploaded by

shajith rr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

SQL Pratice

Uploaded by

shajith rr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

sql * plus

EMPNO ENAME JOB MGR HIREDATE SAL COMM


DEPTNO
---------- ---------- --------- ---------- --------- ---------- ----------
----------
7369 SMITH CLERK 7902 17-DEC-80 800
20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300
30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500
30
7566 JONES MANAGER 7839 02-APR-81 2975
20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400
30
7698 BLAKE MANAGER 7839 01-MAY-81 2850
30
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
7788 SCOTT ANALYST 7566 19-APR-87 3000
20
7839 KING PRESIDENT 17-NOV-81 5000
10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0
30
7876 ADAMS CLERK 7788 23-MAY-87 1100
20

EMPNO ENAME JOB MGR HIREDATE SAL COMM


DEPTNO
---------- ---------- --------- ---------- --------- ---------- ----------
----------
7900 JAMES CLERK 7698 03-DEC-81 950
30
7902 FORD ANALYST 7566 03-DEC-81 3000
20
7934 MILLER CLERK 7782 23-JAN-82 1300
10

DEPTNO DNAME LOC


--------- -------------- -----------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON

topics
------
select
disctinct
alias
from
where
date (before,after)
operatores
- arithmetic
- concatination (||)
- comparision
- relational
- logical operators
and
or
not

- special operator
1. IN
2. NOT IN
3. BETWEEN
4. NOT BETWEEN
5. IS
6. IS NOT
7. LIKE
8. NOT LIKE

order by
single row function
-length
-upper
-lower
-intcap
-mod
-replace
-round
-trunct
multi row function
-max
-min
-avg
-count
-sum

functions
- single row functions
- multi row functions

group by
having

sub - queries
nested sub-queries
ALL, ANY operator

min,max
cross join

i want you to give me query exercises to pratice from above topics, I need query
questions to be tricky and need to test my knowledge. the questions need to be
based on above employee table and I need like 10 - 20 questions, by the end of this
session I can say for sure that i know the above topics very well. the question
must be mixer of all the topics.

sample questions

1.query to display ename,deptno and dname of the emps who are getting comm in dept
10 or 30
2. query to display dnames of emp reporting to turner mgr
3. details along with annual_salary of an emp earning 4th min sal

You might also like