0% found this document useful (0 votes)
351 views2 pages

Oracle SQL

This document provides instructions for connecting to an Oracle database as different users, viewing table and data types, querying table data, changing session settings like page size, viewing command history, and modifying fields in a query. It explains how to check the current login user, connect as sysdba, exit the session, view number and character data types, check tables owned by a user, order query results, set the page size, re-execute a command, and change a field in a query.

Uploaded by

Pri Tersz
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 DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
351 views2 pages

Oracle SQL

This document provides instructions for connecting to an Oracle database as different users, viewing table and data types, querying table data, changing session settings like page size, viewing command history, and modifying fields in a query. It explains how to check the current login user, connect as sysdba, exit the session, view number and character data types, check tables owned by a user, order query results, set the page size, re-execute a command, and change a field in a query.

Uploaded by

Pri Tersz
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 DOCX, PDF, TXT or read online on Scribd

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