Lista de Exerc cios
SQL Básico
1. Inicialize o SQL*Plus utilizando o usuário alunoXX com a senha alunoXX.
2. Selecione a coluna ename, job e sal da tabela EMP. Atribua o alias Salario para sal.
SQL> SELECT ename, job, sal as salário FROM emp;
ENAME JOB SALÁRIO
---------- --------- ----------
SMITH CLERK 800
ALLEN SALESMAN 1600
WARD SALESMAN 1250
JONES MANAGER 2975
MARTIN SALESMAN 1250
BLAKE MANAGER 2850
CLARK MANAGER 2450
SCOTT ANALYST 3000
KING PRESIDENT 5000
TURNER SALESMAN 1500
ADAMS CLERK 1100
ENAME JOB SALÁRIO
---------- --------- ----------
JAMES CLERK 950
FORD ANALYST 3000
MILLER CLERK 1300
3. Selecione todos os dados da tabela salgrade.
SQL> SELECT * FROM emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------- ---------- ---------- DEPTNO
----------
7369 SMITH CLERK 7902 17/12/80 800 20
7499 ALLEN SALESMAN 7698 20/02/81 1600 300 30
7521 WARD SALESMAN 7698 22/02/81 1250 500 30
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------- ---------- ---------- DEPTNO
----------
7566 JONES MANAGER 7839 02/04/81 2975 20
7654 MARTIN SALESMAN 7698 28/09/81 1250 1400 30
7698 BLAKE MANAGER 7839 01/05/81 2850 30
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------- ---------- ---------- DEPTNO
----------
7782 CLARK MANAGER 7839 09/06/81 2450 10
7788