SlideShare una empresa de 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

Más contenido relacionado

Destacado

Grexit webinar slides-06-24-2015
Grexit webinar slides-06-24-2015Grexit webinar slides-06-24-2015
Grexit webinar slides-06-24-2015
hiddenlevers
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec
 
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
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AAS
Kyle 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 1
Kevin Meade
 
PL/SQL Code for Sample Projects
PL/SQL Code for Sample ProjectsPL/SQL Code for Sample Projects
PL/SQL Code for Sample Projects
jwjablonski
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
Simon Huang
 
Advanced Database Lecture Notes
Advanced Database Lecture NotesAdvanced Database Lecture Notes
Advanced Database Lecture Notes
Jasour Obeidat
 

Destacado (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

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

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