SlideShare uma empresa Scribd logo
1 de 18
Database/SQL Overview
Outline
• What is Database
• What is DBMS
• What is Schema
• What is SQL
• SQL Queries
• Database Objects
• DataModelling/ ERD
Database
• 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
• SQL : Structured Query Language
• SQL is a special purpose programming
language designed for managing data held in
RDBMS
• SQL Consists of : DDL(Data Definition
Language) , DML (Data Manipulation
Language) and DCL(Data Control Language)
SQL Queries
• The Most important functionality of SQL query is
to retrieve the data which is achieved using
SELECT statement.
• Any SQL query will have : SELECT and FROM
clause.
SELECT [column, ] group_function(column), ….
FROM table
[WHERE condition]
[GROUP BY column]
[HAVING group_condition]
[ORDER BY column] ;
SQL Clause’s
• 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.
DDL
• 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)
• GRANT
• NOAUDIT
• PURGE
• RENAME
• REVOKE
DML
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
DCL
• 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
an object.
• REVOKE eliminates a grant, which may be the
default grant
TCL
• Transaction control statements manage
changes made by DML statements. The
transaction control statements are:
• COMMIT
• ROLLBACK
• SAVEPOINT
• 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
these tables.
• 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.
Joins (Cont)
• Inner Join
• Equi join
• Natural Join
• Cross Join
• Outer Join
• Left Outer Join
• Right Outer Join
• Full Outer Join
• Self Join
• Cross Join
• Join using MULTIPLE TABLES
SingleRow/MultiRow(Group) Function
• 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
• Hierarchical queries retrieve data based on a
natural hierarchical relationship between rows in
a table.
• Use tree walking to construct a hierarchy
• Syntax :
SELECT [LEVEL], column, expr …
FROM table
[WHERE condition(s) ]
[START WITH conditions(s) ]
[CONNECT BY PRIOR condition(s) ] ;
Database Objects
• Tables (Normal), Global Temporary Table
• Views(Simple, Complex), Materialized View
• Indexes, Constraints, Sequence
• Synonym
• Procedure, Function, Package
• Triggers
• Schema
Data Modelling / ERD
1
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
11 Indexes
12 User Access
13 Datetime
14 SET Operators
15 Hierarchial Table Design, Query
16 Database Architecture
17
ERD Concepts & Data Modelling Using
SQL Data Modeller
18 Tables Vs Global Temporary Table
19 DBMS Scheduller
20 WRAPPER Utility

Mais conteúdo relacionado

Destaque

Oracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptOracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptChien Chung Shen
 
Grexit webinar slides-06-24-2015
Grexit webinar slides-06-24-2015Grexit webinar slides-06-24-2015
Grexit webinar slides-06-24-2015hiddenlevers
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceEnkitec
 
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesEarl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesoramanc
 
Oracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionOracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionGuatemala User Group
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
Extreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGateExtreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGateBobby Curtis
 
Advanced goldengate training ⅰ
Advanced goldengate training ⅰAdvanced goldengate training ⅰ
Advanced goldengate training ⅰoggers
 
Oracle Goldengate training by Vipin Mishra
Oracle Goldengate training by Vipin Mishra Oracle Goldengate training by Vipin Mishra
Oracle Goldengate training by Vipin Mishra Vipin Mishra
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASKyle Hailey
 
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1Kevin Meade
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsEnkitec
 
Oracle LOB Internals and Performance Tuning
Oracle LOB Internals and Performance TuningOracle LOB Internals and Performance Tuning
Oracle LOB Internals and Performance TuningTanel Poder
 
PL/SQL Code for Sample Projects
PL/SQL Code for Sample ProjectsPL/SQL Code for Sample Projects
PL/SQL Code for Sample Projectsjwjablonski
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuningSimon Huang
 
Advanced Database Lecture Notes
Advanced Database Lecture NotesAdvanced Database Lecture Notes
Advanced Database Lecture NotesJasour Obeidat
 
AIN102 Microsoft Access Queries
AIN102 Microsoft Access QueriesAIN102 Microsoft Access Queries
AIN102 Microsoft Access QueriesDan D'Urso
 
AIN106 Access Reporting and Analysis
AIN106 Access Reporting and AnalysisAIN106 Access Reporting and Analysis
AIN106 Access Reporting and AnalysisDan D'Urso
 

Destaque (20)

Database management system
Database management system Database management system
Database management system
 
Oracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptOracle Database Performance Tuning Concept
Oracle Database Performance Tuning Concept
 
Grexit webinar slides-06-24-2015
Grexit webinar slides-06-24-2015Grexit webinar slides-06-24-2015
Grexit webinar slides-06-24-2015
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesEarl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
 
Oracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionOracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL Option
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Extreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGateExtreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGate
 
Advanced goldengate training ⅰ
Advanced goldengate training ⅰAdvanced goldengate training ⅰ
Advanced goldengate training ⅰ
 
Adbms lab manual
Adbms lab manualAdbms lab manual
Adbms lab manual
 
Oracle Goldengate training by Vipin Mishra
Oracle Goldengate training by Vipin Mishra Oracle Goldengate training by Vipin Mishra
Oracle Goldengate training by Vipin Mishra
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AAS
 
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
Oracle LOB Internals and Performance Tuning
Oracle LOB Internals and Performance TuningOracle LOB Internals and Performance Tuning
Oracle LOB Internals and Performance Tuning
 
PL/SQL Code for Sample Projects
PL/SQL Code for Sample ProjectsPL/SQL Code for Sample Projects
PL/SQL Code for Sample Projects
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
 
Advanced Database Lecture Notes
Advanced Database Lecture NotesAdvanced Database Lecture Notes
Advanced Database Lecture Notes
 
AIN102 Microsoft Access Queries
AIN102 Microsoft Access QueriesAIN102 Microsoft Access Queries
AIN102 Microsoft Access Queries
 
AIN106 Access Reporting and Analysis
AIN106 Access Reporting and AnalysisAIN106 Access Reporting and Analysis
AIN106 Access Reporting and Analysis
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 

Último (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 

sql online Training|100%Practical&Live Training

  • 2. Outline • What is Database • What is DBMS • What is Schema • What is SQL • SQL Queries • Database Objects • DataModelling/ ERD
  • 3. Database • 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.
  • 4. 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.
  • 5. SQL • SQL : Structured Query Language • SQL is a special purpose programming language designed for managing data held in RDBMS • SQL Consists of : DDL(Data Definition Language) , DML (Data Manipulation Language) and DCL(Data Control Language)
  • 6. SQL Queries • The Most important functionality of SQL query is to retrieve the data which is achieved using SELECT statement. • Any SQL query will have : SELECT and FROM clause. SELECT [column, ] group_function(column), …. FROM table [WHERE condition] [GROUP BY column] [HAVING group_condition] [ORDER BY column] ;
  • 7. SQL Clause’s • 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.
  • 8. DDL • 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) • GRANT • NOAUDIT • PURGE • RENAME • REVOKE
  • 9. DML 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
  • 10. DCL • 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 an object. • REVOKE eliminates a grant, which may be the default grant
  • 11. TCL • Transaction control statements manage changes made by DML statements. The transaction control statements are: • COMMIT • ROLLBACK • SAVEPOINT • SET TRANSACTION • SET CONSTRAINT
  • 12. 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 these tables. • 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.
  • 13. Joins (Cont) • Inner Join • Equi join • Natural Join • Cross Join • Outer Join • Left Outer Join • Right Outer Join • Full Outer Join • Self Join • Cross Join • Join using MULTIPLE TABLES
  • 14. SingleRow/MultiRow(Group) Function • 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
  • 15. Hierarchical Queries • Hierarchical queries retrieve data based on a natural hierarchical relationship between rows in a table. • Use tree walking to construct a hierarchy • Syntax : SELECT [LEVEL], column, expr … FROM table [WHERE condition(s) ] [START WITH conditions(s) ] [CONNECT BY PRIOR condition(s) ] ;
  • 16. Database Objects • Tables (Normal), Global Temporary Table • Views(Simple, Complex), Materialized View • Indexes, Constraints, Sequence • Synonym • Procedure, Function, Package • Triggers • Schema
  • 18. 1 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 11 Indexes 12 User Access 13 Datetime 14 SET Operators 15 Hierarchial Table Design, Query 16 Database Architecture 17 ERD Concepts & Data Modelling Using SQL Data Modeller 18 Tables Vs Global Temporary Table 19 DBMS Scheduller 20 WRAPPER Utility