0% found this document useful (0 votes)
63 views4 pages

Bai Tap So 1

The document describes operations performed on employee data stored in tables. It shows selecting, filtering, aggregating and formatting data from the EMP and DEPT tables. Various reports on employee name, job, salary, department and other attributes are generated.

Uploaded by

wotuanna
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views4 pages

Bai Tap So 1

The document describes operations performed on employee data stored in tables. It shows selecting, filtering, aggregating and formatting data from the EMP and DEPT tables. Various reports on employee name, job, salary, department and other attributes are generated.

Uploaded by

wotuanna
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

DEPT EMP

S ALGRADE BONUS

BµI tËp thùc hµnh


1. Chän toµn bé th«ng tin trong b¶ng SALGRADE
GRADE LOSAL HISAL
---------- ---------- ----------
1 700 1200
2 1201 1400
3 1401 2000
4 2001 3000
5 3001 9999
2. Chän toµn bé th«ng tin trong b¶ng EMP
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
------ ---------- --------- ----- --------- ----- ------ ----------
7839 KING PRESIDENT 17-11-1981 5000 10
7698 BLAKE MANAGER 7839 01-05-1981 2850 30
7782 CLARK MANAGER 7839 09-06-1981 2450 10
7566 JONES MANAGER 7839 02-04-1981 2975 20
7654 MARTIN SALESMAN 7698 28-09-1981 1250 1400 30
7499 ALLEN SALESMAN 7698 20-02-1981 1600 300 30
7844 TURNER SALESMAN 7698 08-09-1981 1500 0 30
7900 JAMES CLERK 7698 03-12-1981 950 30
7521 WARD SALESMAN 7698 22-02-1981 1250 500 30
7902 FORD ANALYST 7566 03-12-1981 3000 20
7369 SMITH CLERK 7902 17-12-1980 800 20
7788 SCOTT ANALYST 7566 09-12-1982 3000 20
7876 ADAMS CLERK 7788 12-01-1983 1100 20
7934 MILLER CLERK 7782 23-01-1982 1300 10
3. HiÓn thÞ mäi lo¹i nghÒ nghiÖp
JOB
---------
ANALYST
CLERK
MANAGER
PRESIDENT
SALESMAN
4. HiÓn thÞ tªn nh©n viªn vµ thu nhËp trong mét n¨m (REMUNERATION)
ENAME REMUNERATION
---------- ------------
KING 60000
BLAKE 34200
CLARK 29400
JONES 35700
MARTIN 16400
ALLEN 19500
TURNER 18000
JAMES 11400
WARD 15500
FORD 36000
SMITH 9600
SCOTT 36000
ADAMS 13200
MILLER 15600
14 rows selected.
5. HiÓn thÞ theo néi dung díi ®©y
Who, what and when
----------------------------------------------------------------------
KING HAS HELP THE POSITION OF PRESIDENT IN DEPT 10 SINCE 17-11-1981
BLAKE HAS HELP THE POSITION OF MANAGER IN DEPT 30 SINCE 01-05-1981
CLARK HAS HELP THE POSITION OF MANAGER IN DEPT 10 SINCE 09-06-1981
JONES HAS HELP THE POSITION OF MANAGER IN DEPT 20 SINCE 02-04-1981
MARTIN HAS HELP THE POSITION OF SALESMAN IN DEPT 30 SINCE 28-09-1981
ALLEN HAS HELP THE POSITION OF SALESMAN IN DEPT 30 SINCE 20-02-1981
TURNER HAS HELP THE POSITION OF SALESMAN IN DEPT 30 SINCE 08-09-1981
JAMES HAS HELP THE POSITION OF CLERK IN DEPT 30 SINCE 03-12-1981
WARD HAS HELP THE POSITION OF SALESMAN IN DEPT 30 SINCE 22-02-1981
FORD HAS HELP THE POSITION OF ANALYST IN DEPT 20 SINCE 03-12-1981
SMITH HAS HELP THE POSITION OF CLERK IN DEPT 20 SINCE 17-12-1980
SCOTT HAS HELP THE POSITION OF ANALYST IN DEPT 20 SINCE 09-12-1982
ADAMS HAS HELP THE POSITION OF CLERK IN DEPT 20 SINCE 12-01-1983
MILLER HAS HELP THE POSITION OF CLERK IN DEPT 10 SINCE 23-01-1982

14 rows selected.
6. HiÓn thÞ cÊu tróc b¶ng emp;
7. Thay ®æi nh·n vµ ®Þnh d¹ng hiÓn thÞ cña cét sal vµ hiredate trong b¶ng emp;
8. Chän nh©n viªn trong b¶ng EMP cã møc l¬ng tõ 1000 ®Õn 2000 (chän c¸c trêng ENAME, DEPTNO,
SAL).
ENAME DEPTNO SAL
---------- ---------- ----------
ALLEN 30 1600
WARD 30 1250
MARTIN 30 1250
TURNER 30 1500
ADAMS 20 1100
MILLER 10 1300
9.HiÓn thÞ m· phßng ban, tªn phßng ban, s¾p xÕp theo thø tù tªn phßng ban.
DEPTNO DNAME
------ -----------
10 ACCOUNTING
40 OPERATIONS
20 RESEARCH
30 SALES
10. HiÓn thÞ danh s¸ch nh÷ng nh©n viªn lµm t¹i phßng 10 vµ 20 theo thø tù A,B,C
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ----------------- ----- ---------- ---------- ----- -----
7876 ADAMS CLERK 7788 12-01-1983 1100 20
7782 CLARK MANAGER 7839 09-06-1981 2450 10
7902 FORD ANALYST 7566 03-12-1981 3000 20
7566 JONES MANAGER 7839 02-04-1981 2975 20
7839 KING PRESIDENT 17-11-1981 5000 10
7934 MILLER CLERK 7782 23-01-1982 1300 10
7788 SCOTT ANALYST 7566 09-12-1982 3000 20
7369 SMITH CLERK 7902 17-12-1980 800 20
11. HiÓn thÞ tªn vµ nghÒ nghiÖp nh÷ng nh©n viªn lµm nghÒ th ký (cleck) t¹i phßng 20.
ENAME JOB
---------- ---------
SMITH CLERK
ADAMS CLERK
12. HiÓn thÞ tÊt c¶ nh÷ng nh©n viªn mµ tªn cã c¸c ký tù TH vµ LL.
ENAME
----------
SMITH
ALLEN
MILLER
13. HiÓn thÞ tªn nh©n viªn, nghÒ nghiÖp, l¬ng cña nh÷ng nh©n viªn cã gi¸m ®èc qu¶n lý.
ENAME JOB SAL
---------- --------- ----------
SMITH CLERK 800
ALLEN SALESMAN 1600
WARD SALESMAN 1250
JONES MANAGER 2975
MARTIN SALESMAN 1250
BLAKE MANAGER 2850
CLARK MANAGER 2450
SCOTT ANALYST 3000
TURNER SALESMAN 1500
ADAMS CLERK 1100
JAMES CLERK 950
FORD ANALYST 3000
MILLER CLERK 1300

13 rows selected.
14. HiÓn thÞ tªn nh©n viªn, m· phßng ban, ngµy gia nhËp c«ng ty sao cho gia nhËp c«ng ty trong n¨m
1983.
ENAME DEPTNO HIREDATE
---------- ---------- ---------
ADAMS 20 12-JAN-83
15. HiÓn thÞ tªn nh©n viªn, l¬ng mét n¨m (ANUAL_SAL ), thëng sao cho l¬ng lín h¬n thëng vµ nghÒ
nghiÖp lµ SALEMAN, s¾p theo thø tù l¬ng gi¶m dÇn vµ tªn t¨ng dÇn.
ANUAL_SAL COMM
---------- ----------
19200 300
18000 0
15000 500

You might also like