Oracle SQL Part2
Oracle SQL Part2
10 Sep 2023
Agenda
Overview
Configure Oracle SQL Developer
Oracle SQL Basics
Data Definition Language(DDL)
Data Manipulation Language(DML)
Oracle Built-In Functions
Oracle PL/SQL Introduction
Practice
Q&A
Oracle SQL Overview
Structured Query Language (SQL) is the set of statements with which all programs and users access data
in an Oracle Database. The strengths of SQL provide benefits for all types of users, including application
programmers, database administrators, managers, and end users. The purpose of SQL is to provide an
interface to a relational database such as Oracle Database, and all SQL statements are instructions to the
database.
Among the features of SQL are the following:
• It processes sets of data as groups rather than as individual units.
• It provides automatic navigation to the data.
• It uses statements that are complex and powerful individually, and that therefore stand alone. Flow-
control statements, such as begin-end, if-then-else, loops, and exception condition handling, were
initially not part of SQL and the SQL standard, but they can now be found in ISO/IEC 9075-4 -
Persistent Stored Modules (SQL/PSM). The PL/SQL extension to Oracle SQL is similar to PSM.
SQL provides statements for a variety of tasks, including:
• Querying data
• Inserting, updating, and deleting rows in a table
• Creating, replacing, altering, and dropping objects
• Controlling access to the database and its objects
• Guaranteeing database consistency and integrity
Oracle SQL Basics
Basic Elements of Oracle SQL
• Data Types - Each value manipulated by Oracle Database has a data type. The data type of a value
associates a fixed set of properties with the value. These properties cause Oracle to treat values of
one data type differently from values of another. For example, you can add values of NUMBER
data type, but not values of RAW data type.
• Data Type Comparison Rules - Describes how Oracle Database compares values of each data type.
Numeric Values - A larger value is considered greater than a smaller one. All negative numbers
are less than zero and all positive numbers. Thus, -1 is less than 100; -100 is less than -1.
Datetime Values - A later date or timestamp is considered greater than an earlier one. For
example, the date equivalent of '29-MAR-2005' is less than that of '05-JAN-2006' and the
timestamp equivalent of '05-JAN-2006 1:35pm' is greater than that of '05-JAN-2005 10:09am’.
Character Values - Character values are compared on the basis of two measures:
Binary or linguistic collation, which is the default-> Applied whenever one or both values in
the comparison have the data type VARCHAR2 or NVARCHAR2
Blank-padded or nonpadded comparison semantics -> Oracle uses blank-padded comparison
semantics only when both values in the comparison are either expressions of data type
CHAR, NCHAR, text literals
Oracle SQL Basics
Basic Elements of Oracle SQL
Oracle SQL Basics
Basic Elements of Oracle SQL
• Operators - An operator manipulates data items and returns a result. Syntactically, an operator
appears before or after an operand or between two operands.