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
Ad

More Related Content

What's hot (20)

MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
webhostingguy
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
Meysam Javadi
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
Bharat Kalia
 
OLAP
OLAPOLAP
OLAP
Ashir Ali
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
valuebound
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
Ankit Rai
 
Sql ppt
Sql pptSql ppt
Sql ppt
Anuja Lad
 
Database Objects
Database ObjectsDatabase Objects
Database Objects
Salman Memon
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
 
Ibm db2
Ibm db2Ibm db2
Ibm db2
aditi212
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
rehaniltifat
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
Sachidananda M H
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
Md.Mojibul Hoque
 
Database administrator
Database administratorDatabase administrator
Database administrator
Tech_MX
 
Object relational and extended relational databases
Object relational and extended relational databasesObject relational and extended relational databases
Object relational and extended relational databases
Suhad Jihad
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
Mahabubur Rahaman
 
Structured Query Language (SQL)
Structured Query Language (SQL)Structured Query Language (SQL)
Structured Query Language (SQL)
Syed Hassan Ali
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
Nilt1234
 
Partitioning
PartitioningPartitioning
Partitioning
Reema Gajjar
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
Meysam Javadi
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
Bharat Kalia
 
The Basics of MongoDB
The Basics of MongoDBThe Basics of MongoDB
The Basics of MongoDB
valuebound
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
Ankit Rai
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
rehaniltifat
 
Database administrator
Database administratorDatabase administrator
Database administrator
Tech_MX
 
Object relational and extended relational databases
Object relational and extended relational databasesObject relational and extended relational databases
Object relational and extended relational databases
Suhad Jihad
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
Mahabubur Rahaman
 
Structured Query Language (SQL)
Structured Query Language (SQL)Structured Query Language (SQL)
Structured Query Language (SQL)
Syed Hassan Ali
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
Nilt1234
 

Similar to Oracle (20)

SQL, Oracle, Joins
SQL, Oracle, JoinsSQL, Oracle, Joins
SQL, Oracle, Joins
Gaurish Goel
 
Sql Basics And Advanced
Sql Basics And AdvancedSql Basics And Advanced
Sql Basics And Advanced
rainynovember12
 
429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx
429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx
429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx
Harmanjot5678
 
Sql fundamentals
Sql fundamentalsSql fundamentals
Sql fundamentals
Ravinder Kamboj
 
SQL.pptx structure query language in database management system
SQL.pptx structure query language in database management systemSQL.pptx structure query language in database management system
SQL.pptx structure query language in database management system
ironman82715
 
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 guide
1bi08me024
 
Vertica
VerticaVertica
Vertica
Andrey Sidelev
 
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
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
Dr. C.V. Suresh Babu
 
MySql
MySqlMySql
MySql
Sukrit Gupta
 
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
ADBMS Unit-II b
SSN College of Engineering, Kalavakkam
 
Session 2 - "MySQL Basics & Schema Design"
Session 2 - "MySQL Basics & Schema Design"Session 2 - "MySQL Basics & Schema Design"
Session 2 - "MySQL Basics & Schema Design"
LogaRajeshwaranKarth
 
Unit 4 plsql
Unit 4  plsqlUnit 4  plsql
Unit 4 plsql
DrkhanchanaR
 
UNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATION
UNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATIONUNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATION
UNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATION
saranyaksr92
 
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
 
SQL, Oracle, Joins
SQL, Oracle, JoinsSQL, Oracle, Joins
SQL, Oracle, Joins
Gaurish Goel
 
429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx
429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx
429cf300-0dc7-4c2e-9280-d918d69e3cb4.pptx
Harmanjot5678
 
SQL.pptx structure query language in database management system
SQL.pptx structure query language in database management systemSQL.pptx structure query language in database management system
SQL.pptx structure query language in database management system
ironman82715
 
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 guide
1bi08me024
 
Sql Server Interview Question
Sql Server Interview QuestionSql Server Interview Question
Sql Server Interview Question
pukal rani
 
Session 2 - "MySQL Basics & Schema Design"
Session 2 - "MySQL Basics & Schema Design"Session 2 - "MySQL Basics & Schema Design"
Session 2 - "MySQL Basics & Schema Design"
LogaRajeshwaranKarth
 
UNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATION
UNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATIONUNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATION
UNIT 3 SQL 10.pdf ORACEL DATABASE QUERY OPTIMIZATION
saranyaksr92
 
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
 
Ad

More from JIGAR MAKHIJA (20)

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
 
Php pattern matching
Php pattern matchingPhp pattern matching
Php pattern matching
JIGAR MAKHIJA
 
Php server variables
Php server variablesPhp server variables
Php server variables
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
 
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
 
Ad

Recently uploaded (20)

One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 

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;