• What is Database
• What is DBMS
• What is Schema
• What is SQL
• SQL Queries
• Database Objects
• DataModelling/ ERD
• A database is an organized collection of data. The data
are typically organized in appropriate manner which
allows to process the data in a easy way.
• Database management systems (DBMSs) are specially
designed applications that interact with the user, other
applications, and the database itself to capture and
analyze data. A general-purpose database
management system (DBMS) is a software system
designed to allow the
definition, creation, querying, update, and
administration of databases.
What is Schema
• A schema is collection of database
objects, including logical structures such as
tables, views, sequences, stored
procedures, synonyms, indexes, clusters, and
database links, triggers, packages etc.
• A user owns a schema.
• A user and a schema have the same name.
• SQL : Structured Query Language
• SQL is a special purpose programming
language designed for managing data held in
• SQL Consists of : DDL(Data Definition
Language) , DML (Data Manipulation
Language) and DCL(Data Control Language)
• The Most important functionality of SQL query is
to retrieve the data which is achieved using
• Any SQL query will have : SELECT and FROM
SELECT [column, ] group_function(column), ….
[GROUP BY column]
[ORDER BY column] ;
• SELECT clause indicates which columns to be shown in the output.
• FROM clause which indicates the tables from which data is to be retrieved.
• WHERE clause includes a comparison operator, which restricts the rows
returned by the query.
• GROUP BY clause is used to project rows having common values into a
smaller set of rows. GROUP BY is often used in conjunction with SQL
aggregation functions or to eliminate duplicate rows from a result set.
The WHERE clause is applied before the GROUP BY clause.
• HAVING clause includes a predicate used to filter rows resulting from
the GROUP BY clause.
• ORDER BY clause identifies which columns are used to sort the resulting
data, and in which direction they should be sorted (options are ascending
or descending). Without an ORDER BY clause, the order of rows returned
by an SQL query is undefined.
• Data Definition Language (DDL) statements are used to define the
database structure or schema. Some examples:
• CREATE - to create objects in the database
• ALTER - alters the structure of the database
• DROP - delete objects from the database
• TRUNCATE - remove all records from a table, including all spaces allocated
for the records are removed
• COMMENT - add comments to the data dictionary
• RENAME - rename an object…
• FLASHBACK ... (All statements beginning with FLASHBACK)
Data Manipulation Language (DML) statements are used for managing data
within schema objects. Some examples:
• SELECT - retrieve data from the a database
The SELECT statement is a limited form of DML statement in that it can
only access data in the database. It cannot manipulate data stored in the
database, although it can manipulate the accessed data before returning
the results of the query.
• INSERT - insert data into a table
• UPDATE - updates existing data within a table
• DELETE - deletes all records from a table, the space for the records remain
• MERGE - UPSERT operation (insert or update)
• CALL - call a PL/SQL or Java subprogram
• EXPLAIN PLAN - explain access path to data
• LOCK TABLE - control concurrency
• The Data Control Language (DCL) authorizes
users to access and manipulate data. Its two
main statements are
• GRANT authorizes one or more users to
perform an operation or a set of operations on
• REVOKE eliminates a grant, which may be the
• Transaction control statements manage
changes made by DML statements. The
transaction control statements are:
• SET TRANSACTION
• SET CONSTRAINT
What is a Join?
• A join is a query that combines rows from two or
more tables, views, or materialized views.
• Oracle performs a join whenever multiple tables
appear in the query's FROM clause. The query's
select list can select any columns from any of
• If any two of these tables have a column name in
common, you must qualify all references to these
columns throughout the query with table names
to avoid ambiguity.
• Single row functions : Operate on single rows only and
return one result per row .
• Different Types of Single row functions are
– Character : UPPER, LOWER
– Number : MOD
– Date Conversion : TO_DATE
– General :NVL, NVL2, NULLIF
• Multiple row functions: Manipulates groups of rows to
give one result per group of rows.
• Also called as group functions
• Ex: COUNT, MAX, MIN
• Hierarchical queries retrieve data based on a
natural hierarchical relationship between rows in
• Use tree walking to construct a hierarchy
• Syntax :
SELECT [LEVEL], column, expr …
[WHERE condition(s) ]
[START WITH conditions(s) ]
[CONNECT BY PRIOR condition(s) ] ;
Basic SQL Statement, SELECT,FROM Clause
2 Sorting : ORDER BY , WHERE Clause
3 Single Row Function
4 Multiple Tables Data - Joins
5 Group Functions - GROUP BY Clause
6 Sub Queries
7 Manipulating data
8 Create tables
9 Constraints (PK,FK, UK)
10 Views , Materialized Views
12 User Access
14 SET Operators
15 Hierarchial Table Design, Query
16 Database Architecture
ERD Concepts & Data Modelling Using
SQL Data Modeller
18 Tables Vs Global Temporary Table
19 DBMS Scheduller
20 WRAPPER Utility