Вы находитесь на странице: 1из 13

SQL> select chr (90) from dual;

C
-
Z

SQL> select * from dual;

D
-
X

SQL> select 'name-'||ename|| 'is gating ' || sal||' salary ' from emp where sal=3000;

'NAME-'||ENAME||'ISGATING'||SAL||'SALARY'
-------------------------------------------------------------------------
name-SCOTTis gating 3000 salary
name-FORDis gating 3000 salary

SQL> select * from emp;

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
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

14 rows selected.

SQL> seelctv ceil (48.876) from dual;


unknown command beginning "seelctv ce..." - rest of line ignored.
SQL> select ceil (48.876) from dual;

CEIL(48.876)
------------
49

SQL> select abs(-250) from dual;

ABS(-250)
---------
250

SQL> select exp (5) from dual;

EXP(5)
---------
148.41316

SQL> select floor (48.876) from dual;

FLOOR(48.876)
-------------
48

SQL> select in (1000) from dual;


select in (1000) from dual
*
ERROR at line 1:
ORA-00936: missing expression

SQL> select ln (1000) from dual;

LN(1000)
---------
6.9077553

SQL> select ln (10) from dual;

LN(10)
---------
2.3025851

SQL> select log (10,10) from dual;]


2 cselect ln (10
3
SQL> select log (10,10) from dual;

LOG(10,10)
----------
1

SQL> select mod (500,2) from dual;

MOD(500,2)
----------
0

SQL> select power (2,7) from dual;

POWER(2,7)
----------
128

SQL> select round (87.945,2) from dual;

ROUND(87.945,2)
---------------
87.95

SQL> select round (87.945456,3) from dual;

ROUND(87.945456,3)
------------------
87.945

SQL> select sign (-22) from dual;

SIGN(-22)
---------
-1

SQL> select sign (222222) from dual;

SIGN(222222)
------------
1

SQL> select sin (90) from dual;

SIN(90)
---------
.89399666

SQL> select sqrt (5000000000 from dual;


select sqrt (5000000000 from dual
*
ERROR at line 1:
ORA-00907: missing right parenthesis

SQL> select sqrt (45) from dual;

SQRT(45)
---------
6.7082039

SQL> select trunc(45.7698)n from dual;

N
---------
45

SQL> select ename from emp where soundx ( ename )= soundex('scott');


select ename from emp where soundx ( ename )= soundex('scott')
*
ERROR at line 1:
ORA-00904: invalid column name

SQL> select ename from emp where soundex ( ename )= soundex('scott');

ENAME
----------
SCOTT

SQL> select to_char(sysdate,'dd\mm\yy') from dual;

TO_CHAR(
--------
29\07\10

SQL> select to_char(sysdate,'dd\mm\yy') from dual;

TO_CHAR(
--------
30\07\10

SQL> select uid from dual;

UID
---------
20

SQL> select user from dual;

USER
------------------------------
SCOTT

SQL> select nvl (activity , 0) from sycm;


select nvl (activity , 0) from sycm
*
ERROR at line 1:
ORA-00904: invalid column name

SQL> select nvl (comm,0) from dual;


select nvl (comm,0) from dual
*
ERROR at line 1:
ORA-00904: invalid column name

SQL> select vsize ('avanti') from sycm;

no rows selected

SQL> select vsize ('dhan') from dhan;


select vsize ('dhan') from dhan
*
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> select roll from sycm unoio select acts_no from acts;
select roll from sycm unoio select acts_no from acts
*
ERROR at line 1:
ORA-00933: SQL command not properly ended

SQL>
SQL>
SQL> select vsize ('avanti s t ') from dual;

VSIZE('AVANTIST')
-----------------
11

SQL>
SQL> select avg (sal) from emp;

AVG(SAL)
---------
2073.2143

SQL> select count (*) from emp;

COUNT(*)
---------
14

SQL> commit;

Commit complete.

SQL> select roll from sycm ;


select roll from sycm
*
ERROR at line 1:
ORA-00904: invalid column name

SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL> select * from tab;

TNAME TABTYPE CLUSTERID


------------------------------ ------- ---------
APP TABLE
AVANTI TABLE
BABASAHEB TABLE
BONUS TABLE
DEPT TABLE
EMP TABLE
RANI TABLE
SALGRADE TABLE
SYCM TABLE
VISH TABLE

10 rows selected.

SQL> desc rani;


Name Null? Type
------------------------------- -------- ----
ROLL NOT NULL NUMBER(4)
NAME VARCHAR2(20)
DOB DATE

SQL> desc avanti;


Name Null? Type
------------------------------- -------- ----
NAME VARCHAR2(20)
ACTIVITY VARCHAR2(10)
ROLL_NO NUMBER(4)
ACTS_NO NUMBER(5)
CITY VARCHAR2(20) SQL> select * from emp;

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
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

14 rows selected.

SQL> seelctv ceil (48.876) from dual;


unknown command beginning "seelctv ce..." - rest of line ignored.
SQL> select ceil (48.876) from dual;

CEIL(48.876)
------------
49
SQL> select abs(-250) from dual;

ABS(-250)
---------
250

SQL> select exp (5) from dual;

EXP(5)
---------
148.41316

SQL> select floor (48.876) from dual;

FLOOR(48.876)
-------------
48

SQL> select in (1000) from dual;


select in (1000) from dual
*
ERROR at line 1:
ORA-00936: missing expression

SQL> select ln (1000) from dual;

LN(1000)
---------
6.9077553

SQL> select ln (10) from dual;

LN(10)
---------
2.3025851

SQL> select log (10,10) from dual;]


2 cselect ln (10
3
SQL> select log (10,10) from dual;

LOG(10,10)
----------
1
SQL> select mod (500,2) from dual;

MOD(500,2)
----------
0

SQL> select power (2,7) from dual;

POWER(2,7)
----------
128

SQL> select round (87.945,2) from dual;

ROUND(87.945,2)
---------------
87.95

SQL> select round (87.945456,3) from dual;

ROUND(87.945456,3)
------------------
87.945

SQL> select sign (-22) from dual;

SIGN(-22)
---------
-1

SQL> select sign (222222) from dual;

SIGN(222222)
------------
1

SQL> select sin (90) from dual;

SIN(90)
---------
.89399666

SQL> select sqrt (5000000000 from dual;


select sqrt (5000000000 from dual
*
ERROR at line 1:
ORA-00907: missing right parenthesis

SQL> select sqrt (45) from dual;

SQRT(45)
---------
6.7082039

SQL> select trunc(45.7698)n from dual;

N
---------
45

SQL> select ename from emp where soundx ( ename )= soundex('scott');


select ename from emp where soundx ( ename )= soundex('scott')
*
ERROR at line 1:
ORA-00904: invalid column name

SQL> select ename from emp where soundex ( ename )= soundex('scott');

ENAME
----------
SCOTT

SQL> select to_char(sysdate,'dd\mm\yy') from dual;

TO_CHAR(
--------
29\07\10

SQL> select to_char(sysdate,'dd\mm\yy') from dual;

TO_CHAR(
--------
30\07\10

SQL> select uid from dual;

UID
---------
20
SQL> select user from dual;

USER
------------------------------
SCOTT

SQL> select nvl (activity , 0) from sycm;


select nvl (activity , 0) from sycm
*
ERROR at line 1:
ORA-00904: invalid column name

SQL> select nvl (comm,0) from dual;


select nvl (comm,0) from dual
*
ERROR at line 1:
ORA-00904: invalid column name

SQL> select vsize ('avanti') from sycm;

no rows selected

SQL> select vsize ('dhan') from dhan;


select vsize ('dhan') from dhan
*
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> select roll from sycm unoio select acts_no from acts;
select roll from sycm unoio select acts_no from acts
*
ERROR at line 1:
ORA-00933: SQL command not properly ended

SQL>
SQL>
SQL> select vsize ('avanti s t ') from dual;

VSIZE('AVANTIST')
-----------------
11
SQL>
SQL> select avg (sal) from emp;

AVG(SAL)
---------
2073.2143

SQL> select count (*) from emp;

COUNT(*)
---------
14

SQL> commit;

Commit complete.

SQL> select roll from sycm ;


select roll from sycm
*
ERROR at line 1:
ORA-00904: invalid column name

SQL> select * from tab;

TNAME TABTYPE CLUSTERID


------------------------------ ------- ---------
APP TABLE
AVANTI TABLE
BABASAHEB TABLE
BONUS TABLE
DEPT TABLE
EMP TABLE
RANI TABLE
SALGRADE TABLE
SYCM TABLE
VISH TABLE

10 rows selected.

SQL> desc rani;


Name Null? Type
------------------------------- -------- ----
ROLL NOT NULL NUMBER(4)
NAME VARCHAR2(20)
DOB DATE

SQL> desc avanti;


Name Null? Type
------------------------------- -------- ----
NAME VARCHAR2(20)
ACTIVITY VARCHAR2(10)
ROLL_NO NUMBER(4)
ACTS_NO NUMBER(5)
CITY VARCHAR2(20)