SlideShare a Scribd company logo
Oracle for
Beginners
BY: Jigar M.
What is Oracle
– Oracle database is a relational database management system. It is known as
Oracle database, Oracle DB or simply Oracle. It is produced and marketed by
Oracle Corporation.
– Oracle database is the first database designed for enterprise grid computing.
The enterprise grid computing provides the most flexible and cost effective way
to manage information and applications.
Different editions of Oracle
database
Following are the four editions of the Oracle database.
– Enterprise Edition: It is the most robust and secure edition. It offers all features,
including superior performance and security.
– Standard Edition: It provides the base functionality for users that do not require
Enterprise Edition's robust package.
– Express Edition (XE): It is the lightweight, free and limited Windows and Linux
edition.
– Oracle Lite: It is designed for mobile devices
Introduction to Oracle Datatypes
– Oracle provides the following categories of built-in datatypes:
– Overview of Character Datatypes
– Overview of Numeric Datatypes
– Overview of DATE Datatype
– Overview of LOB Datatypes
Overview of Character
Datatypes
– The character datatypes store character (alphanumeric) data in strings, with
byte values corresponding to the character encoding scheme, generally called a
character set or code page.
– The database's character set is established when you create the database.
Examples of character sets are 7-bit ASCII (American Standard Code for
Information Interchange), EBCDIC (Extended Binary Coded Decimal Interchange
Code), Code Page 500, Japan Extended UNIX, and Unicode UTF-8. Oracle
supports both single-byte and multibyte encoding schemes.
CHAR Datatype
– The CHAR datatype stores fixed-length character strings. When you create a
table with a CHAR column, you must specify a string length (in bytes or
characters) between 1 and 2000 bytes for the CHAR column width. The default
is 1 byte. Oracle then guarantees that:
 When you insert or update a row in the table, the value for the CHAR column has the
fixed length.
 If you give a shorter value, then the value is blank-padded to the fixed length.
 If a value is too large, Oracle Database returns an error.
VARCHAR2 and VARCHAR
Datatypes
– The VARCHAR2 datatype stores variable-length character strings. When you create a
table with a VARCHAR2 column, you specify a maximum string length (in bytes or
characters) between 1 and 4000 bytes for the VARCHAR2 column. For each row,
Oracle Database stores each value in the column as a variable-length field unless a
value exceeds the column's maximum length, in which case Oracle Database returns
an error. Using VARCHAR2 and VARCHAR saves on space used by the table.
– For example, assume you declare a column VARCHAR2 with a maximum size of 50
characters. In a single-byte character set, if only 10 characters are given for the
VARCHAR2 column value in a particular row, the column in the row's row piece
stores only the 10 characters (10 bytes), not 50.
VARCHAR Datatype
– The VARCHAR datatype is synonymous with the VARCHAR2 datatype. To avoid
possible changes in behavior, always use the VARCHAR2 datatype to store
variable-length character strings.
NCHAR and NVARCHAR2
Datatypes
– NCHAR and NVARCHAR2 are Unicode datatypes that store Unicode character
data. The character set of NCHAR and NVARCHAR2 datatypes can only be either
AL16UTF16 or UTF8 and is specified at database creation time as the national
character set. AL16UTF16 and UTF8 are both Unicode encoding.
 The NCHAR datatype stores fixed-length character strings that correspond to the
national character set.
 The NVARCHAR2 datatype stores variable length character strings.
Contd.
NCHAR
– The maximum length of an NCHAR column is 2000 bytes. It can hold up to 2000
characters. The actual data is subject to the maximum byte limit of 2000. The
two size constraints must be satisfied simultaneously at run time.
NVARCHAR2
– The maximum length of an NVARCHAR2 column is 4000 bytes. It can hold up to
4000 characters. The actual data is subject to the maximum byte limit of 4000.
The two size constraints must be satisfied simultaneously at run time.
LOB Character Datatypes
– The LOB datatypes for character data are CLOB and NCLOB. They can store up to
8 terabytes of character data (CLOB) or national character set data (NCLOB).
Note:
– Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead.
LONG columns are supported only for backward compatibility.
– Oracle also recommends that you convert existing LONG columns to LOB columns.
LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB
functionality is enhanced in every release, whereas LONG functionality has been
static for several releases
LONG Datatype
– Columns defined as LONG can store variable-length character data containing
up to 2 gigabytes of information. LONG data is text data that is to be
appropriately converted when moving among different systems.
– LONG datatype columns are used in the data dictionary to store the text of view
definitions. You can use LONG columns in SELECT lists, SET clauses of UPDATE
statements, and VALUES clauses of INSERT statements.
Overview of Numeric Datatypes
– The numeric datatypes store positive and negative fixed and floating-point
numbers, zero, infinity, and values that are the undefined result of an operation
(that is, is "not a number" or NAN).
– This section includes the following topics:
– NUMBER Datatype
– Floating-Point Numbers
NUMBER Datatype
– The NUMBER datatype stores fixed and floating-point numbers. Numbers of
virtually any magnitude can be stored and are guaranteed portable among
different systems operating Oracle Database, up to 38 digits of precision.
– For numeric columns, you can specify the column as:
– column_name NUMBER
– Optionally, you can also specify a precision (total number of digits) and scale
(number of digits to the right of the decimal point):
– column_name NUMBER (precision, scale)
Floating-Point Numbers
– Oracle Database provides two numeric datatypes exclusively for floating-point
numbers: BINARY_FLOAT and BINARY_DOUBLE.
– This section includes the following topics:
– BINARY_FLOAT Datatype
– BINARY_DOUBLE Datatype
Contd
BINARY_FLOAT Datatype
– BINARY_FLOAT is a 32-bit, single-precision floating-point number datatype. Each
BINARY_FLOAT value requires 5 bytes, including a length byte.
BINARY_DOUBLE Datatype
– BINARY_DOUBLE is a 64-bit, double-precision floating-point number datatype.
Each BINARY_DOUBLE value requires 9 bytes, including a length byte.
Overview of DATE Datatype
– The DATE datatype stores point-in-time values (dates and times) in a table. The
DATE datatype stores the year (including the century), the month, the day, the
hours, the minutes, and the seconds (after midnight).
– For input and output of dates, the standard Oracle date format is DD-MON-YY,
as follows:'13-NOV-92'
– You can change this default date format for an instance with the parameter
NLS_DATE_FORMAT.
– TO_DATE ('November 13, 1992', 'MONTH DD, YYYY')
Time Zones
Datatype Time Zone Fractional Seconds
DATE No No
TIMESTAMP No Yes
TIMESTAMP WITH TIME
ZONE
Explicit Yes
TIMESTAMP WITH LOCAL
TIME ZONE
Relative Yes
Overview of LOB Datatypes
– The LOB datatypes BLOB, CLOB, NCLOB, and BFILE enable you to store and manipulate large blocks
of unstructured data (such as text, graphic images, video clips, and sound waveforms) in binary or
character format.
– LOB datatypes differ from LONG and LONG RAW datatypes in several ways. For example:
 A table can contain multiple LOB columns but only one LONG column.
 A table containing one or more LOB columns can be partitioned, but a table containing a LONG column cannot
be partitioned.
 The maximum size of a LOB is 128 terabytes depending on database block size, and the maximum size of a
LONG is only 2 gigabytes.
 LOBs support random access to data, but LONGs support only sequential access.
 LOB datatypes (except NCLOB) can be attributes of a user-defined object type but LONG datatypes cannot.
 Tables with LOB columns can be replicated, but tables with LONG columns cannot.
Contd
– SQL statements define LOB columns in a table and LOB attributes in a user-defined
object type. When defining LOBs in a table, you can explicitly specify the tablespace
and storage characteristics for each LOB.
– LOB datatypes can be stored inline (within a table), out-of-line (within a tablespace,
using a LOB locator), or in an external file (BFILE datatypes). With compatibility set
to Oracle9i or higher, you can use LOBs with SQL VARCHAR operators and functions.
– This section includes the following topics:
 BLOB Datatype
 CLOB and NCLOB Datatypes
 BFILE Datatype
BLOB Datatype
– The BLOB datatype stores unstructured binary data in the database. BLOBs can
store up to 128 terabytes of binary data.
– BLOBs participate fully in transactions. Changes made to a BLOB value by the
DBMS_LOB package, PL/SQL, or the OCI can be committed or rolled back.
However, BLOB locators cannot span transactions or sessions.
CLOB and NCLOB Datatypes
– The CLOB and NCLOB datatypes store up to 128 terabytes of character data in the
database. CLOBs store database character set data, and NCLOBs store Unicode
national character set data. Storing varying-width LOB data in a fixed-width Unicode
character set internally enables Oracle Database to provide efficient character-
based random access on CLOBs and NCLOBs.
– CLOBs and NCLOBs participate fully in transactions. Changes made to a CLOB or
NCLOB value by the DBMS_LOB package, PL/SQL, or the OCI can be committed or
rolled back. However, CLOB and NCLOB locators cannot span transactions or
sessions. You cannot create an object type with NCLOB attributes, but you can
specify NCLOB parameters in a method for an object type.
BFILE Datatype
– The BFILE datatype stores unstructured binary data in operating-system files
outside the database. A BFILE column or attribute stores a file locator that
points to an external file containing the data. The amount of BFILE data that can
be stored is limited by the operating system.
– BFILEs are read only; you cannot modify them. They support only random (not
sequential) reads, and they do not participate in transactions. The underlying
operating system must maintain the file integrity, security, and durability for
BFILEs. The database administrator must ensure that the file exists and that
Oracle Database processes have operating-system read permissions on the file.
Oracle CREATE TABLE
CREATE TABLE table_name
(
column1 datatype [ NULL | NOT NULL ],
column2 datatype [ NULL | NOT NULL ],
...
column_n datatype [ NULL | NOT NULL ]
);
– table_name: It specifies the name of
the table which you want to create.
– column1, column2, ... column n: It
specifies the columns which you want
to add in the table. Every column must
have a datatype. Every column should
either be defined as "NULL" or "NOT
NULL". In the case, the value is left
blank; it is treated as "NULL" as default.
What is Primary key
– A primary key is a single field or combination of fields that contains a unique
record. It must be filled. None of the field of primary key can contain a null
value. A table can have only one primary key.
– Oracle CREATE TABLE Example with primary key
CREATE TABLE customers
( customer_id number(10) NOT NULL,
customer_name varchar2(50) NOT NULL,
city varchar2(50),
CONSTRAINT customers_pk PRIMARY KEY (customer_id)
);
Oracle ALTER TABLE
Statement
– In Oracle, ALTER TABLE statement specifies how to add, modify, drop or delete
columns in a table. It is also used to rename a table
– How to add column in a table
ALTER TABLE table_name ADD column_name column-definition;
Example:
ALTER TABLE customers ADD customer_age varchar2(50);
– How to modify multiple columns of a table
ALTER TABLE table_name MODIFY (column_1 column_type,
column_2 column_type, ...
column_n column_type);
How to drop column of a table
Syntax
– ALTER TABLE table_name DROP COLUMN column_name;
Example
– ALTER TABLE customers DROP COLUMN customer_name;
How to rename column of a table
Syntax
– ALTER TABLE table_name RENAME COLUMN old_name to new_name;
Example
– ALTER TABLE customers RENAME COLUMN customer_name to cname;
How to rename table
Syntax
– ALTER TABLE table_name RENAME TO new_table_name;
Example
– ALTER TABLE customers RENAME TO retailers;
Continued to Part-2
Thank You

More Related Content

What's hot

An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
Meysam Javadi
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overviewhonglee71
 
Oracle database introduction
Oracle database introductionOracle database introduction
Oracle database introduction
Mohammad Javad Beheshtian
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
Sharad Dubey
 
Oracle architecture ppt
Oracle architecture pptOracle architecture ppt
Oracle architecture ppt
Deepak Shetty
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
Bharat Kalia
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
Ehsan Hamzei
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Object oriented databases
Object oriented databasesObject oriented databases
Object oriented databases
Sajith Ekanayaka
 
SQL commands
SQL commandsSQL commands
SQL commands
GirdharRatne
 
SQL - RDBMS Concepts
SQL - RDBMS ConceptsSQL - RDBMS Concepts
SQL - RDBMS Concepts
WebStackAcademy
 
Er model ppt
Er model pptEr model ppt
Er model ppt
Pihu Goel
 
Data Models
Data ModelsData Models
Data Models
RituBhargava7
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMSkoolkampus
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
Siti Ismail
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
Md.Mojibul Hoque
 
Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)
Bilal Arshad
 

What's hot (20)

An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
Oracle database introduction
Oracle database introductionOracle database introduction
Oracle database introduction
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Oracle architecture ppt
Oracle architecture pptOracle architecture ppt
Oracle architecture ppt
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Object oriented databases
Object oriented databasesObject oriented databases
Object oriented databases
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
SQL commands
SQL commandsSQL commands
SQL commands
 
SQL - RDBMS Concepts
SQL - RDBMS ConceptsSQL - RDBMS Concepts
SQL - RDBMS Concepts
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Data Models
Data ModelsData Models
Data Models
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)Introduction to oracle database (basic concepts)
Introduction to oracle database (basic concepts)
 

Similar to Oracle

SQL, Oracle, Joins
SQL, Oracle, JoinsSQL, Oracle, Joins
SQL, Oracle, JoinsGaurish Goel
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
rainynovember12
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
Ravinder Kamboj
 
SQL-1.pptx for database system and system query language
SQL-1.pptx for database system  and system query languageSQL-1.pptx for database system  and system query language
SQL-1.pptx for database system and system query language
ironman82715
 
Plsql quick guide
Plsql quick guidePlsql quick guide
Plsql quick guide1bi08me024
 
Vertica
VerticaVertica
1650607.ppt
1650607.ppt1650607.ppt
1650607.ppt
KalsoomTahir2
 
Sql Server Interview Question
Sql Server Interview QuestionSql Server Interview Question
Sql Server Interview Question
pukal rani
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
Dr. C.V. Suresh Babu
 
MySql
MySqlMySql
2016 02 23_biological_databases_part2
2016 02 23_biological_databases_part22016 02 23_biological_databases_part2
2016 02 23_biological_databases_part2
Prof. Wim Van Criekinge
 
ADBMS Unit-II b
ADBMS Unit-II bADBMS Unit-II b
Unit 4 plsql
Unit 4  plsqlUnit 4  plsql
Unit 4 plsql
DrkhanchanaR
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload
Prof. Wim Van Criekinge
 
2017 biological databasespart2
2017 biological databasespart22017 biological databasespart2
2017 biological databasespart2
Prof. Wim Van Criekinge
 
Oracle Introduction
Oracle Introduction Oracle Introduction
Oracle Introduction
Mohana Rajendiran
 
Dbmsunit v
Dbmsunit vDbmsunit v
Dbmsunit v
Mohana Rajendiran
 
Database Sizing
Database SizingDatabase Sizing
Database Sizing
Amin Chowdhury
 
PO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - SqlPO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - Sql
Zespół Szkół nr 26
 

Similar to Oracle (20)

SQL, Oracle, Joins
SQL, Oracle, JoinsSQL, Oracle, Joins
SQL, Oracle, Joins
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
 
SQL-1.pptx for database system and system query language
SQL-1.pptx for database system  and system query languageSQL-1.pptx for database system  and system query language
SQL-1.pptx for database system and system query language
 
Plsql quick guide
Plsql quick guidePlsql quick guide
Plsql quick guide
 
Vertica
VerticaVertica
Vertica
 
1650607.ppt
1650607.ppt1650607.ppt
1650607.ppt
 
Sql Server Interview Question
Sql Server Interview QuestionSql Server Interview Question
Sql Server Interview Question
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
MySql
MySqlMySql
MySql
 
2016 02 23_biological_databases_part2
2016 02 23_biological_databases_part22016 02 23_biological_databases_part2
2016 02 23_biological_databases_part2
 
ADBMS Unit-II b
ADBMS Unit-II bADBMS Unit-II b
ADBMS Unit-II b
 
Unit 4 plsql
Unit 4  plsqlUnit 4  plsql
Unit 4 plsql
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload
 
2017 biological databasespart2
2017 biological databasespart22017 biological databasespart2
2017 biological databasespart2
 
Oracle Introduction
Oracle Introduction Oracle Introduction
Oracle Introduction
 
Dbmsunit v
Dbmsunit vDbmsunit v
Dbmsunit v
 
Database Sizing
Database SizingDatabase Sizing
Database Sizing
 
PO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - SqlPO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - Sql
 

More from JIGAR MAKHIJA

Php gd library
Php gd libraryPhp gd library
Php gd library
JIGAR MAKHIJA
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
JIGAR MAKHIJA
 
Php cookies
Php cookiesPhp cookies
Php cookies
JIGAR MAKHIJA
 
Php functions
Php functionsPhp functions
Php functions
JIGAR MAKHIJA
 
Php sessions
Php sessionsPhp sessions
Php sessions
JIGAR MAKHIJA
 
Php server variables
Php server variablesPhp server variables
Php server variables
JIGAR MAKHIJA
 
Db function
Db functionDb function
Db function
JIGAR MAKHIJA
 
C++ version 1
C++  version 1C++  version 1
C++ version 1
JIGAR MAKHIJA
 
C++ Version 2
C++  Version 2C++  Version 2
C++ Version 2
JIGAR MAKHIJA
 
SAP Ui5 content
SAP Ui5 contentSAP Ui5 content
SAP Ui5 content
JIGAR MAKHIJA
 
Solution doc
Solution docSolution doc
Solution doc
JIGAR MAKHIJA
 
Overview on Application protocols in Internet of Things
Overview on Application protocols in Internet of ThingsOverview on Application protocols in Internet of Things
Overview on Application protocols in Internet of Things
JIGAR MAKHIJA
 
125 green iot
125 green iot125 green iot
125 green iot
JIGAR MAKHIJA
 
Msp430 g2 with ble(Bluetooth Low Energy)
Msp430 g2 with ble(Bluetooth Low Energy)Msp430 g2 with ble(Bluetooth Low Energy)
Msp430 g2 with ble(Bluetooth Low Energy)
JIGAR MAKHIJA
 
Embedded system lab work
Embedded system lab workEmbedded system lab work
Embedded system lab work
JIGAR MAKHIJA
 
Presentation on iot- Internet of Things
Presentation on iot- Internet of ThingsPresentation on iot- Internet of Things
Presentation on iot- Internet of Things
JIGAR MAKHIJA
 
Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120
JIGAR MAKHIJA
 
View Alignment Techniques
View Alignment TechniquesView Alignment Techniques
View Alignment Techniques
JIGAR MAKHIJA
 
Letters (complaints & invitations)
Letters (complaints & invitations)Letters (complaints & invitations)
Letters (complaints & invitations)
JIGAR MAKHIJA
 
Letter Writing invitation-letter
Letter Writing invitation-letterLetter Writing invitation-letter
Letter Writing invitation-letter
JIGAR MAKHIJA
 

More from JIGAR MAKHIJA (20)

Php gd library
Php gd libraryPhp gd library
Php gd library
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
 
Php cookies
Php cookiesPhp cookies
Php cookies
 
Php functions
Php functionsPhp functions
Php functions
 
Php sessions
Php sessionsPhp sessions
Php sessions
 
Php server variables
Php server variablesPhp server variables
Php server variables
 
Db function
Db functionDb function
Db function
 
C++ version 1
C++  version 1C++  version 1
C++ version 1
 
C++ Version 2
C++  Version 2C++  Version 2
C++ Version 2
 
SAP Ui5 content
SAP Ui5 contentSAP Ui5 content
SAP Ui5 content
 
Solution doc
Solution docSolution doc
Solution doc
 
Overview on Application protocols in Internet of Things
Overview on Application protocols in Internet of ThingsOverview on Application protocols in Internet of Things
Overview on Application protocols in Internet of Things
 
125 green iot
125 green iot125 green iot
125 green iot
 
Msp430 g2 with ble(Bluetooth Low Energy)
Msp430 g2 with ble(Bluetooth Low Energy)Msp430 g2 with ble(Bluetooth Low Energy)
Msp430 g2 with ble(Bluetooth Low Energy)
 
Embedded system lab work
Embedded system lab workEmbedded system lab work
Embedded system lab work
 
Presentation on iot- Internet of Things
Presentation on iot- Internet of ThingsPresentation on iot- Internet of Things
Presentation on iot- Internet of Things
 
Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120Learn Japanese -Basic kanji 120
Learn Japanese -Basic kanji 120
 
View Alignment Techniques
View Alignment TechniquesView Alignment Techniques
View Alignment Techniques
 
Letters (complaints & invitations)
Letters (complaints & invitations)Letters (complaints & invitations)
Letters (complaints & invitations)
 
Letter Writing invitation-letter
Letter Writing invitation-letterLetter Writing invitation-letter
Letter Writing invitation-letter
 

Recently uploaded

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 

Recently uploaded (20)

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 

Oracle

  • 2. What is Oracle – Oracle database is a relational database management system. It is known as Oracle database, Oracle DB or simply Oracle. It is produced and marketed by Oracle Corporation. – Oracle database is the first database designed for enterprise grid computing. The enterprise grid computing provides the most flexible and cost effective way to manage information and applications.
  • 3. Different editions of Oracle database Following are the four editions of the Oracle database. – Enterprise Edition: It is the most robust and secure edition. It offers all features, including superior performance and security. – Standard Edition: It provides the base functionality for users that do not require Enterprise Edition's robust package. – Express Edition (XE): It is the lightweight, free and limited Windows and Linux edition. – Oracle Lite: It is designed for mobile devices
  • 4. Introduction to Oracle Datatypes – Oracle provides the following categories of built-in datatypes: – Overview of Character Datatypes – Overview of Numeric Datatypes – Overview of DATE Datatype – Overview of LOB Datatypes
  • 5. Overview of Character Datatypes – The character datatypes store character (alphanumeric) data in strings, with byte values corresponding to the character encoding scheme, generally called a character set or code page. – The database's character set is established when you create the database. Examples of character sets are 7-bit ASCII (American Standard Code for Information Interchange), EBCDIC (Extended Binary Coded Decimal Interchange Code), Code Page 500, Japan Extended UNIX, and Unicode UTF-8. Oracle supports both single-byte and multibyte encoding schemes.
  • 6. CHAR Datatype – The CHAR datatype stores fixed-length character strings. When you create a table with a CHAR column, you must specify a string length (in bytes or characters) between 1 and 2000 bytes for the CHAR column width. The default is 1 byte. Oracle then guarantees that:  When you insert or update a row in the table, the value for the CHAR column has the fixed length.  If you give a shorter value, then the value is blank-padded to the fixed length.  If a value is too large, Oracle Database returns an error.
  • 7. VARCHAR2 and VARCHAR Datatypes – The VARCHAR2 datatype stores variable-length character strings. When you create a table with a VARCHAR2 column, you specify a maximum string length (in bytes or characters) between 1 and 4000 bytes for the VARCHAR2 column. For each row, Oracle Database stores each value in the column as a variable-length field unless a value exceeds the column's maximum length, in which case Oracle Database returns an error. Using VARCHAR2 and VARCHAR saves on space used by the table. – For example, assume you declare a column VARCHAR2 with a maximum size of 50 characters. In a single-byte character set, if only 10 characters are given for the VARCHAR2 column value in a particular row, the column in the row's row piece stores only the 10 characters (10 bytes), not 50.
  • 8. VARCHAR Datatype – The VARCHAR datatype is synonymous with the VARCHAR2 datatype. To avoid possible changes in behavior, always use the VARCHAR2 datatype to store variable-length character strings.
  • 9. NCHAR and NVARCHAR2 Datatypes – NCHAR and NVARCHAR2 are Unicode datatypes that store Unicode character data. The character set of NCHAR and NVARCHAR2 datatypes can only be either AL16UTF16 or UTF8 and is specified at database creation time as the national character set. AL16UTF16 and UTF8 are both Unicode encoding.  The NCHAR datatype stores fixed-length character strings that correspond to the national character set.  The NVARCHAR2 datatype stores variable length character strings.
  • 10. Contd. NCHAR – The maximum length of an NCHAR column is 2000 bytes. It can hold up to 2000 characters. The actual data is subject to the maximum byte limit of 2000. The two size constraints must be satisfied simultaneously at run time. NVARCHAR2 – The maximum length of an NVARCHAR2 column is 4000 bytes. It can hold up to 4000 characters. The actual data is subject to the maximum byte limit of 4000. The two size constraints must be satisfied simultaneously at run time.
  • 11. LOB Character Datatypes – The LOB datatypes for character data are CLOB and NCLOB. They can store up to 8 terabytes of character data (CLOB) or national character set data (NCLOB). Note: – Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead. LONG columns are supported only for backward compatibility. – Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases
  • 12. LONG Datatype – Columns defined as LONG can store variable-length character data containing up to 2 gigabytes of information. LONG data is text data that is to be appropriately converted when moving among different systems. – LONG datatype columns are used in the data dictionary to store the text of view definitions. You can use LONG columns in SELECT lists, SET clauses of UPDATE statements, and VALUES clauses of INSERT statements.
  • 13. Overview of Numeric Datatypes – The numeric datatypes store positive and negative fixed and floating-point numbers, zero, infinity, and values that are the undefined result of an operation (that is, is "not a number" or NAN). – This section includes the following topics: – NUMBER Datatype – Floating-Point Numbers
  • 14. NUMBER Datatype – The NUMBER datatype stores fixed and floating-point numbers. Numbers of virtually any magnitude can be stored and are guaranteed portable among different systems operating Oracle Database, up to 38 digits of precision. – For numeric columns, you can specify the column as: – column_name NUMBER – Optionally, you can also specify a precision (total number of digits) and scale (number of digits to the right of the decimal point): – column_name NUMBER (precision, scale)
  • 15. Floating-Point Numbers – Oracle Database provides two numeric datatypes exclusively for floating-point numbers: BINARY_FLOAT and BINARY_DOUBLE. – This section includes the following topics: – BINARY_FLOAT Datatype – BINARY_DOUBLE Datatype
  • 16. Contd BINARY_FLOAT Datatype – BINARY_FLOAT is a 32-bit, single-precision floating-point number datatype. Each BINARY_FLOAT value requires 5 bytes, including a length byte. BINARY_DOUBLE Datatype – BINARY_DOUBLE is a 64-bit, double-precision floating-point number datatype. Each BINARY_DOUBLE value requires 9 bytes, including a length byte.
  • 17. Overview of DATE Datatype – The DATE datatype stores point-in-time values (dates and times) in a table. The DATE datatype stores the year (including the century), the month, the day, the hours, the minutes, and the seconds (after midnight). – For input and output of dates, the standard Oracle date format is DD-MON-YY, as follows:'13-NOV-92' – You can change this default date format for an instance with the parameter NLS_DATE_FORMAT. – TO_DATE ('November 13, 1992', 'MONTH DD, YYYY')
  • 18. Time Zones Datatype Time Zone Fractional Seconds DATE No No TIMESTAMP No Yes TIMESTAMP WITH TIME ZONE Explicit Yes TIMESTAMP WITH LOCAL TIME ZONE Relative Yes
  • 19. Overview of LOB Datatypes – The LOB datatypes BLOB, CLOB, NCLOB, and BFILE enable you to store and manipulate large blocks of unstructured data (such as text, graphic images, video clips, and sound waveforms) in binary or character format. – LOB datatypes differ from LONG and LONG RAW datatypes in several ways. For example:  A table can contain multiple LOB columns but only one LONG column.  A table containing one or more LOB columns can be partitioned, but a table containing a LONG column cannot be partitioned.  The maximum size of a LOB is 128 terabytes depending on database block size, and the maximum size of a LONG is only 2 gigabytes.  LOBs support random access to data, but LONGs support only sequential access.  LOB datatypes (except NCLOB) can be attributes of a user-defined object type but LONG datatypes cannot.  Tables with LOB columns can be replicated, but tables with LONG columns cannot.
  • 20. Contd – SQL statements define LOB columns in a table and LOB attributes in a user-defined object type. When defining LOBs in a table, you can explicitly specify the tablespace and storage characteristics for each LOB. – LOB datatypes can be stored inline (within a table), out-of-line (within a tablespace, using a LOB locator), or in an external file (BFILE datatypes). With compatibility set to Oracle9i or higher, you can use LOBs with SQL VARCHAR operators and functions. – This section includes the following topics:  BLOB Datatype  CLOB and NCLOB Datatypes  BFILE Datatype
  • 21. BLOB Datatype – The BLOB datatype stores unstructured binary data in the database. BLOBs can store up to 128 terabytes of binary data. – BLOBs participate fully in transactions. Changes made to a BLOB value by the DBMS_LOB package, PL/SQL, or the OCI can be committed or rolled back. However, BLOB locators cannot span transactions or sessions.
  • 22. CLOB and NCLOB Datatypes – The CLOB and NCLOB datatypes store up to 128 terabytes of character data in the database. CLOBs store database character set data, and NCLOBs store Unicode national character set data. Storing varying-width LOB data in a fixed-width Unicode character set internally enables Oracle Database to provide efficient character- based random access on CLOBs and NCLOBs. – CLOBs and NCLOBs participate fully in transactions. Changes made to a CLOB or NCLOB value by the DBMS_LOB package, PL/SQL, or the OCI can be committed or rolled back. However, CLOB and NCLOB locators cannot span transactions or sessions. You cannot create an object type with NCLOB attributes, but you can specify NCLOB parameters in a method for an object type.
  • 23. BFILE Datatype – The BFILE datatype stores unstructured binary data in operating-system files outside the database. A BFILE column or attribute stores a file locator that points to an external file containing the data. The amount of BFILE data that can be stored is limited by the operating system. – BFILEs are read only; you cannot modify them. They support only random (not sequential) reads, and they do not participate in transactions. The underlying operating system must maintain the file integrity, security, and durability for BFILEs. The database administrator must ensure that the file exists and that Oracle Database processes have operating-system read permissions on the file.
  • 24. Oracle CREATE TABLE CREATE TABLE table_name ( column1 datatype [ NULL | NOT NULL ], column2 datatype [ NULL | NOT NULL ], ... column_n datatype [ NULL | NOT NULL ] ); – table_name: It specifies the name of the table which you want to create. – column1, column2, ... column n: It specifies the columns which you want to add in the table. Every column must have a datatype. Every column should either be defined as "NULL" or "NOT NULL". In the case, the value is left blank; it is treated as "NULL" as default.
  • 25. What is Primary key – A primary key is a single field or combination of fields that contains a unique record. It must be filled. None of the field of primary key can contain a null value. A table can have only one primary key. – Oracle CREATE TABLE Example with primary key CREATE TABLE customers ( customer_id number(10) NOT NULL, customer_name varchar2(50) NOT NULL, city varchar2(50), CONSTRAINT customers_pk PRIMARY KEY (customer_id) );
  • 26. Oracle ALTER TABLE Statement – In Oracle, ALTER TABLE statement specifies how to add, modify, drop or delete columns in a table. It is also used to rename a table – How to add column in a table ALTER TABLE table_name ADD column_name column-definition; Example: ALTER TABLE customers ADD customer_age varchar2(50); – How to modify multiple columns of a table ALTER TABLE table_name MODIFY (column_1 column_type, column_2 column_type, ... column_n column_type);
  • 27. How to drop column of a table Syntax – ALTER TABLE table_name DROP COLUMN column_name; Example – ALTER TABLE customers DROP COLUMN customer_name;
  • 28. How to rename column of a table Syntax – ALTER TABLE table_name RENAME COLUMN old_name to new_name; Example – ALTER TABLE customers RENAME COLUMN customer_name to cname;
  • 29. How to rename table Syntax – ALTER TABLE table_name RENAME TO new_table_name; Example – ALTER TABLE customers RENAME TO retailers;