Monday, 6 February 2017

MORE INTRODUCTION ON ORACLE

In databases if any user wants to store data into database or manage data in database, minimum two steps are required. These are -
  • The user first connect with the database - In Oracle users are connect with the database by using a tool in Oracle, by default tool is SQL*Plus tool.
  • Then only communicate with the database by using SQL language.
Each Oracle version having two editions. Theses are - 
  • Express Edition
  • Enterprise Edition
In this two editions by default username is "system" and password is "manager". In Enterprise edition Oracle provides another user "scott" along with "system" user where username is "scott" and password is "tiger". Scott user having following predefined Oracle tables. These are - 
  • emp
  • dept
Start ----> Programs ----> Oracle ----> Application Development ----> SQL*Plus

Type username as "scott" and pasword as "tiger".

Error : Account locked

Type username "\ sys as sysdba" and password as "sys"

SQL> alter user scott account unlock
SQL> conn scott/tiger
Enter password : tiger
Confirm password : tiger

TO CLEAR SCREEN

SQL> cl scr; or shift+del

TO VIEW ALL TABLES

SQL> select * from tab;

TO VIEW PARTICULAR TABLE DATA

SQL> select * from emp;

In SQL*Plus tool having 80 characters per line. If a table having more than 80 characters per a line, then that table data does not displayed properly. To overcome with this problem we must set SQL*Plus environment settings by using predefined SQL*Plus tool commands. If we want to set more than 80 characters per line then we are using following syntax -
SQL> set linesize 100;

In SQL*Plus tool every page having 14 lines only. If we want to change page size then we are using following syntax -
SQL> set pagesize 50;

If we want to view SQL*Plus tool environment setting commands then we are using following syntax SQL> show all;

SQL (STRUCTURED QUERY LANGUAGE)

SQL is an structured query language which is used to operate relational database products. In 1970 E.F.CODD introduced relational data model and also DSL/alpha language for operating relational databases. In IBM company system/R team developed modified version of DSL/alpha language called "Square". Again IBM modified Square language into "Sequel" (Structured English Query Language). Again IBM changed "Sequel" into "SQL" . ANSI (American National Standard Institute) provided some standards into SQL language. That's why SQL is also called as ANSI SQL. From this standard Oracle creating their own SQL called Oracle SQL. Oracle SQL having following sub languages -

  1. Data Definition Language ( DDL ) - Create, Alter, Truncate, Drop, Rename
  2. Data Manipulation Language ( DML ) - Insert, Update, Delete, Merge
  3. Data Retrieval / Query Language ( DRL/DQL ) - Select
  4. Transaction Control Language ( TCL ) - Commit, Rollback, Savepoint
  5. Data Control Language ( DCL ) - Grant, Revoke 
ORACLE SQL DATA TYPES
  • Character Datatypes - char, nchar, nvarchar2, varchar2
  • Numeric Datatypes
  • DATE Datatypes
  • Long Datatypes
  • LOB Datatypes
  • RAW and LONG RAW Datatypes
  • ROWID and UROWID Datatypes

No comments:

Post a Comment