Oracle SQL

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

ORACLE SQL/PL SQL

To check what user your login in type define

To login in as a different user connect as sysdba

Connect scott/tiger

to exit type quit

Data types

Number (3)

Number(2,2) Example .23

Varchar2(10) Example. Can variably store up to 10 characters ( if you have a name called
“smith” then it will store only 5 bytes)

Char(10) Example. Example this would store only 10 characters (if you have a name called
“smith” still it will store 10 bytes)

Date Example it stores the date time & month

To check which tables does a user own

SQL>select table_name from user_tables;

SQL> select empno,ename,job,hiredate,sal from emp order by 2;

to change the page size

SQL> set pagesize 200

to execute the previous command

SQL>/

To view command history


SQL>list

to change some details on the quarry

SQL>c/empno(the_field_we_need_to_change)/deptno(the_new_feild)

You might also like