SlideShare a Scribd company logo
MULTIPLE TABLES
The required data are in more than one
table , related tables are using a join
condition.
The join condition combines a row in one
table with a row in another table based on
the same values in the common columns.
Different types of joins based on the join
condition used.
JOIN
Equijoin
None quijoin
Outer join
Self join
TYPES OF JOIN

The equijoin is a join with a
join condition involving common
columns from two tables.
Syntax:
SELECT column names
FROM table names
WHERE join condition(s);
1.EQUIJOIN

 There is no matching column in
the EMPLEVEL tables for the salary
column in the EMPLOYEE table.
 The join condition for these tables
can be written using any operator
other than the =operator that is why it
is called non-equijoin.
2.NONEQUIJOIN

 If a row in one table does not have
a matching value in the other table it is not
joined.
 you would change your query’s
join condition and create a join known as an
outer join.
 The outer join uses the(+)operator
in the join condition on the deficient side.
3.OUTER JOIN

SELECT1.columnname,tablename2
.column name
FROM tablename1,tablename2
WHERE
tablename1.columnname(+) =
tablename2.columnname;
syntax

 A Self join is joining a table to
itself. one join that is not so easy to
understand.
 a tables is joined to itself two
copies of the same table are loaded or
used.
 they are treated like any two
different tables and a join is produced
from those two copies.
4.SELF JOIN

In set operators learned about union,
intersection and difference operations if you
recall these operations are possible on
“union-compatible” tables.
The implementation of these operations
is through the use of set operators.
SET OPERATORS

SELECT-Query 1
set operator
SELECT-Query 2;
where set operator is one of
the four set operators described.
Syntax
UNION - It returns all rows from
both queries but duplicate rows are not
repeated.
UNION ALL – It returns all from both
queries and it displays all duplicate rows.
INTERSECT – It returns all rows that
appear in both queries results.
MINUS – It returns rows that are
returned by the first query minus rows
that are returned by the second query.
SET OPERATOR AND USE

sub query are also known as nested
query .a sub query is usually a
SELECT query within one of the
clauses in another SELECT query.
1. Single –row query
2. multiple –row query.
SUBQUERY
A sub query that returns only one row of data
it is also known as a scalar sub query. The sub
query must be enclosed within a pair of
parentheses .The ORDER BY clause cannot be
used in a sub query.
SYNTEX
SELECT column list
FROM table name
WHERE column operator
(SELECT column names
FROM table name
WHERE condition
SINGLE ROW SUBQUERY

You can create a table by using a nested
SELECT query .the query will create a new
table and populate it with the rows selected
from the other table .
syntax :
CREATE TABLE table name
AS
SELECT query;
CREATING A TABLE USING A
SUBQUERY

An existing table can be populated
with a sub query .the table must already
exist to insert rows into it .
syntax
INSERT INTO
table name [(column list)]
SELECT columns
names FROM table name WHERE
conditions;
INSERT USING A SUBQUERY

In most cases you uses the
INSERT statement to add a row into
a table .
1. INSERT ALL(conditional
&unconditional)
2. INSERT FIRST
INSERTING INTO MULTIPLE
TABLES

The rows are selected from the EMPLOYEE table
and inserted into two existing tables ,
EMPLOYEE_SALARY and EMPLOYEE _DEPT.
syntax
INSERT ALL
INTO employee _salary
VALUES(Employee id ,L
name , F name salary commission
UNCONDITIONAL INSERT
ALL

INTO employee _dept
VALUES(Employee id ,L name , F name, Dept id,
supervisor)
SELECT Employee id ,L name , F name, salary,
commission , dept id , supervisor
FROM employee WHERE salary > 50000 OR
dept id <>40;

The rows are inserted into tables based on their individual conditions .
The WHEN…..THEN clause is used with different conditions for
inserting rows into different tables.
SYNTAX
INSERT ALL
WHEN Salary >50000
THEN INTO employee _salary
VALUES (employee id, L name ,F name
, salary ,commission )
WHEN dept id<>40 THEN
INTO employee _dept
VALUES(employee id ,L name , F
name , Dept id ,supervisor)
SELECT employee id , L name , F name , salary ,
CONDITIONAL INSERT
ALL

A row or rows from a table can be deleted
based on a value returned by a sub query.
SYNTAX :
DELETE FROM table name
WHERE column name =
( SELECT sub query) ;
DELETE USING A
SUBQUERY

A multiple –row sub query
returns more than one row . the
operator used in single row sub
queries (=,<>,>,>=,< and <=)
cannot be used with multiple –
row sub query.
MULTIPLE ROW
SUBQUERY

MERGE STATEMENT
You can use the MERGE statement to perform
INSERT and UPDATE operations together . This operation
is very useful in data warehousing .
CORRELATED SUBQUERY
In a Correlated sub query the inner (nested )query
can reference columns from the outer query .The inner query
is executed once for each row in the outer query . In other
sub quries the inner query was excueted only once.

The EXISTS and NOT EXISTS
operators are used with
correlated queries . The EXISTS
operator checks if the inner
query returns at least one row.
EXISTS AND NOT EXISTS
OPERATORS

A view is an oracle object
that gives the user a logical view of
data from an underlying table or
tables. When a view is created from
than one tables ,the user can view data
from the without using join condition
and complex conditions.
VIEW

A view is created with a SELECT sub
query. The sub query cannot use an
ORDER by clause but a view can.
syntax:
CREATE [OR REPLACE] VIEW
view name [column aliases]
AS SELECT – sub query
[WITH CHECK OPTION
[CONSTRAINT constraint name]]
[WITH READ ONLY];
CREATING VIEW

A user who owns a view or who
has the privilege to remove it – can
remove a view. The removal of a view
does not affect data in the underlying
table.
when a view is removed a “view
dropped” message is displayed.
DROP VIEW view name;
REMOVING A VIEW

When you alter an underlying table
the view becomes invalid. You need to
recompile that view to make it valid
again.
the ALTER VIEW statement is
used for the re –compilation of a view.
ALTER VIEW deptsalvu COMPILE;
ALTERTING A VIEW

A sequence is an oracle object that is
used to generate a sequence of
number sequencing is a perfect
solution for generating values for such
numeric columns. A sequence is a not
primary key columns but can be used
on any numeric column.
SEQUENCES

CREATE SEQUENCE sequencename
[INCREMENT BY n]
[START WITH s]
[MAXVALUE x NOMAXVALUE]
[MINVALUE m NOMINVALUE]
[CYCLE NOCYCLE]
[CACHE cNOCACHE]
[ORDERNOORDER]
syntax

 Modify a sequence if you own it or
have ALTER SEQUENCE .
 Modify sequence does not affect past
numbers only generated in the future.
Modification of a sequence does not
allow you to change the starting value.
 The maximum value cannot be set to a
number less than the current number.
MODIFYING A
SEQUENCE

ALTER SEQUENCE sequencename
[INCREMENT BY n]
[MAXVALUE x NOMAXVALUE]
[MINVALUE m NOMINVALUE]
[CYCLENOCYCLE]
[CACHE cNOCACHE]
[ORDERNOORDER];
syntax

You can drop a sequence with the
DROP SEQUENCE statement. A
removed sequence cannot be used
anymore.
DROPSEQUENCE major
Majorid seq;
DROPPING A SEQUENCE

 synonyms are oracle objects that are used to create
alternative names for tables ,views , sequnces and
other objects.
 you can create a synonyms for username .table
name
 a synonym name must be different than all than
the other objects owned by the user.
 A synonym can be removed by using the DROP
SYNONYM statement.
 A user can get information about synonyms and
their table names by using oracle data dictionary
table , USER SYNONYMS
SYNONYMS

An index is another oracle object
that is used for faster retrieval of
rows from a table. an index can be
created explicitly by using the
CREATE INDEX statement or
implicitly by oracle.
INDEX

 An index based on a combined of column is called
 composite index or CONCATENATED INDEX.
 The general syntax is :
CREATE INDEX index name
ON
tablename(columnname1,[columnname2],…);
 The TABLESPACE and STORAGE clause can be
used
 with the CREATE INDEX statement.
 When a table goes through many changes
(insertions, delections,and updates), it is
advisable to rebuild indexes based on that table.
 You can drop an index and recreate it, but it is
faster to just rebuild an existing index.
 Rebuild compacts index data and improves
performance.
 For example,
ALTER INDEX student_ index REBUILD;
REBUILDING AN INDEX
A user’s access needs to be controlled in
a shared, multiuser oracle environment.
A user’s access to the database can be
restricted, and a user may or may not be
allowed to use certain objects in the
database.
Security is classified into two types:
SYSTEM SECURITY
DATABASE SECURITY
CONTROLLING ACCESSS

Defines access to the database at the
system level.
It is implemented by assigning a
username and password, allocating
disk space, and providing a user
with the ability to perform system
operations.
SYSTEM SECURITY
Defines a user’s access to various
objects' and the tasks a user can
perform on them.
The database administrator[DBA]is
the most trusted user ,and a DBA is
the most trusted user, and a DBA has
all the privileges. A DBA can create
users, assign them.
Database security

An object privileges specifies what a
user can do with a database object,
such as a table, sequence, or a view.
 There are 11 basic object privileges,
and each object has a set of privileges
out of the total of 11 privileges.
OBJECT PRIVILEGES

More Related Content

What's hot

SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functionsVikas Gupta
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
SQL, Embedded SQL, Dynamic SQL and SQLJ
SQL, Embedded SQL, Dynamic SQL and SQLJSQL, Embedded SQL, Dynamic SQL and SQLJ
SQL, Embedded SQL, Dynamic SQL and SQLJ
Dharita Chokshi
 
Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
Sql DML
Sql DMLSql DML
Sql DML
Vikas Gupta
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
Smriti Jain
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
Md.Mojibul Hoque
 
Oracle: DML
Oracle: DMLOracle: DML
Oracle: DML
DataminingTools Inc
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
Stewart Rogers
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
Sabana Maharjan
 
SQL
SQLSQL
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
PadamNepal1
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In SqlAnurag
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
DrRShaliniVISTAS
 
Oracle Course
Oracle CourseOracle Course
Oracle Courserspaike
 
Sql
SqlSql
Retrieving data using the sql select statement
Retrieving data using the sql select statementRetrieving data using the sql select statement
Retrieving data using the sql select statement
Syed Zaid Irshad
 

What's hot (20)

MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
SQL, Embedded SQL, Dynamic SQL and SQLJ
SQL, Embedded SQL, Dynamic SQL and SQLJSQL, Embedded SQL, Dynamic SQL and SQLJ
SQL, Embedded SQL, Dynamic SQL and SQLJ
 
Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
 
Sql DML
Sql DMLSql DML
Sql DML
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
Oracle: DML
Oracle: DMLOracle: DML
Oracle: DML
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
 
SQL
SQLSQL
SQL
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Oracle Course
Oracle CourseOracle Course
Oracle Course
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Sql
SqlSql
Sql
 
Retrieving data using the sql select statement
Retrieving data using the sql select statementRetrieving data using the sql select statement
Retrieving data using the sql select statement
 

Similar to MULTIPLE TABLES

Its about a sql topic for basic structured query language
Its about a sql topic for basic structured query languageIts about a sql topic for basic structured query language
Its about a sql topic for basic structured query language
IMsKanchanaI
 
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQueryPPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
Abhishek590097
 
Advanced Sql Training
Advanced Sql TrainingAdvanced Sql Training
Advanced Sql Training
bixxman
 
SQL Query
SQL QuerySQL Query
SQL Query
Imam340267
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
jainendraKUMAR55
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptx
EllenGracePorras
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
DataminingTools Inc
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
oracle content
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
Dev Chauhan
 
Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2
Techglyphs
 
SQL
SQLSQL
Sql Queries
Sql QueriesSql Queries
Sql Querieswebicon
 
Day-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptxDay-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptx
uzmasulthana3
 
1 introduction to my sql
1 introduction to my sql1 introduction to my sql
1 introduction to my sql
Prof. Erwin Globio
 
Interview Questions.pdf
Interview Questions.pdfInterview Questions.pdf
Interview Questions.pdf
TarunKumar893717
 

Similar to MULTIPLE TABLES (20)

Its about a sql topic for basic structured query language
Its about a sql topic for basic structured query languageIts about a sql topic for basic structured query language
Its about a sql topic for basic structured query language
 
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQueryPPT  of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
PPT of Common Table Expression (CTE), Window Functions, JOINS, SubQuery
 
Advanced Sql Training
Advanced Sql TrainingAdvanced Sql Training
Advanced Sql Training
 
SQL Query
SQL QuerySQL Query
SQL Query
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptx
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
Query
QueryQuery
Query
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
 
Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2
 
SQL
SQLSQL
SQL
 
Sql Queries
Sql QueriesSql Queries
Sql Queries
 
SQL
SQLSQL
SQL
 
Day-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptxDay-2 SQL Theory_V1.pptx
Day-2 SQL Theory_V1.pptx
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
Views, Triggers, Functions, Stored Procedures,  Indexing and JoinsViews, Triggers, Functions, Stored Procedures,  Indexing and Joins
Views, Triggers, Functions, Stored Procedures, Indexing and Joins
 
1 introduction to my sql
1 introduction to my sql1 introduction to my sql
1 introduction to my sql
 
Interview Questions.pdf
Interview Questions.pdfInterview Questions.pdf
Interview Questions.pdf
 

More from ASHABOOPATHY

Unit4
Unit4Unit4
Unit3
Unit3Unit3
Unit2
Unit2Unit2
Unit3
Unit3Unit3
Unit1
Unit1Unit1
Unit2
Unit2Unit2
Unit1
Unit1Unit1
ORACLE PL/SQL
ORACLE PL/SQLORACLE PL/SQL
ORACLE PL/SQL
ASHABOOPATHY
 
Orcal FUNCTIONS
Orcal FUNCTIONSOrcal FUNCTIONS
Orcal FUNCTIONS
ASHABOOPATHY
 
Oracel CURSOR AND EXCEPTIONS
Oracel CURSOR AND EXCEPTIONSOracel CURSOR AND EXCEPTIONS
Oracel CURSOR AND EXCEPTIONS
ASHABOOPATHY
 
OrACLE RELATIONAL
OrACLE RELATIONALOrACLE RELATIONAL
OrACLE RELATIONAL
ASHABOOPATHY
 
Ora1
Ora1Ora1
Phpbase
PhpbasePhpbase
Phpbase
ASHABOOPATHY
 

More from ASHABOOPATHY (13)

Unit4
Unit4Unit4
Unit4
 
Unit3
Unit3Unit3
Unit3
 
Unit2
Unit2Unit2
Unit2
 
Unit3
Unit3Unit3
Unit3
 
Unit1
Unit1Unit1
Unit1
 
Unit2
Unit2Unit2
Unit2
 
Unit1
Unit1Unit1
Unit1
 
ORACLE PL/SQL
ORACLE PL/SQLORACLE PL/SQL
ORACLE PL/SQL
 
Orcal FUNCTIONS
Orcal FUNCTIONSOrcal FUNCTIONS
Orcal FUNCTIONS
 
Oracel CURSOR AND EXCEPTIONS
Oracel CURSOR AND EXCEPTIONSOracel CURSOR AND EXCEPTIONS
Oracel CURSOR AND EXCEPTIONS
 
OrACLE RELATIONAL
OrACLE RELATIONALOrACLE RELATIONAL
OrACLE RELATIONAL
 
Ora1
Ora1Ora1
Ora1
 
Phpbase
PhpbasePhpbase
Phpbase
 

Recently uploaded

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 

Recently uploaded (20)

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 

MULTIPLE TABLES

  • 2. The required data are in more than one table , related tables are using a join condition. The join condition combines a row in one table with a row in another table based on the same values in the common columns. Different types of joins based on the join condition used. JOIN
  • 4.  The equijoin is a join with a join condition involving common columns from two tables. Syntax: SELECT column names FROM table names WHERE join condition(s); 1.EQUIJOIN
  • 5.   There is no matching column in the EMPLEVEL tables for the salary column in the EMPLOYEE table.  The join condition for these tables can be written using any operator other than the =operator that is why it is called non-equijoin. 2.NONEQUIJOIN
  • 6.   If a row in one table does not have a matching value in the other table it is not joined.  you would change your query’s join condition and create a join known as an outer join.  The outer join uses the(+)operator in the join condition on the deficient side. 3.OUTER JOIN
  • 8.   A Self join is joining a table to itself. one join that is not so easy to understand.  a tables is joined to itself two copies of the same table are loaded or used.  they are treated like any two different tables and a join is produced from those two copies. 4.SELF JOIN
  • 9.  In set operators learned about union, intersection and difference operations if you recall these operations are possible on “union-compatible” tables. The implementation of these operations is through the use of set operators. SET OPERATORS
  • 10.  SELECT-Query 1 set operator SELECT-Query 2; where set operator is one of the four set operators described. Syntax
  • 11. UNION - It returns all rows from both queries but duplicate rows are not repeated. UNION ALL – It returns all from both queries and it displays all duplicate rows. INTERSECT – It returns all rows that appear in both queries results. MINUS – It returns rows that are returned by the first query minus rows that are returned by the second query. SET OPERATOR AND USE
  • 12.  sub query are also known as nested query .a sub query is usually a SELECT query within one of the clauses in another SELECT query. 1. Single –row query 2. multiple –row query. SUBQUERY
  • 13. A sub query that returns only one row of data it is also known as a scalar sub query. The sub query must be enclosed within a pair of parentheses .The ORDER BY clause cannot be used in a sub query. SYNTEX SELECT column list FROM table name WHERE column operator (SELECT column names FROM table name WHERE condition SINGLE ROW SUBQUERY
  • 14.  You can create a table by using a nested SELECT query .the query will create a new table and populate it with the rows selected from the other table . syntax : CREATE TABLE table name AS SELECT query; CREATING A TABLE USING A SUBQUERY
  • 15.  An existing table can be populated with a sub query .the table must already exist to insert rows into it . syntax INSERT INTO table name [(column list)] SELECT columns names FROM table name WHERE conditions; INSERT USING A SUBQUERY
  • 16.  In most cases you uses the INSERT statement to add a row into a table . 1. INSERT ALL(conditional &unconditional) 2. INSERT FIRST INSERTING INTO MULTIPLE TABLES
  • 17.  The rows are selected from the EMPLOYEE table and inserted into two existing tables , EMPLOYEE_SALARY and EMPLOYEE _DEPT. syntax INSERT ALL INTO employee _salary VALUES(Employee id ,L name , F name salary commission UNCONDITIONAL INSERT ALL
  • 18.  INTO employee _dept VALUES(Employee id ,L name , F name, Dept id, supervisor) SELECT Employee id ,L name , F name, salary, commission , dept id , supervisor FROM employee WHERE salary > 50000 OR dept id <>40;
  • 19.  The rows are inserted into tables based on their individual conditions . The WHEN…..THEN clause is used with different conditions for inserting rows into different tables. SYNTAX INSERT ALL WHEN Salary >50000 THEN INTO employee _salary VALUES (employee id, L name ,F name , salary ,commission ) WHEN dept id<>40 THEN INTO employee _dept VALUES(employee id ,L name , F name , Dept id ,supervisor) SELECT employee id , L name , F name , salary , CONDITIONAL INSERT ALL
  • 20.  A row or rows from a table can be deleted based on a value returned by a sub query. SYNTAX : DELETE FROM table name WHERE column name = ( SELECT sub query) ; DELETE USING A SUBQUERY
  • 21.  A multiple –row sub query returns more than one row . the operator used in single row sub queries (=,<>,>,>=,< and <=) cannot be used with multiple – row sub query. MULTIPLE ROW SUBQUERY
  • 22.  MERGE STATEMENT You can use the MERGE statement to perform INSERT and UPDATE operations together . This operation is very useful in data warehousing . CORRELATED SUBQUERY In a Correlated sub query the inner (nested )query can reference columns from the outer query .The inner query is executed once for each row in the outer query . In other sub quries the inner query was excueted only once.
  • 23.  The EXISTS and NOT EXISTS operators are used with correlated queries . The EXISTS operator checks if the inner query returns at least one row. EXISTS AND NOT EXISTS OPERATORS
  • 24.  A view is an oracle object that gives the user a logical view of data from an underlying table or tables. When a view is created from than one tables ,the user can view data from the without using join condition and complex conditions. VIEW
  • 25.  A view is created with a SELECT sub query. The sub query cannot use an ORDER by clause but a view can. syntax: CREATE [OR REPLACE] VIEW view name [column aliases] AS SELECT – sub query [WITH CHECK OPTION [CONSTRAINT constraint name]] [WITH READ ONLY]; CREATING VIEW
  • 26.  A user who owns a view or who has the privilege to remove it – can remove a view. The removal of a view does not affect data in the underlying table. when a view is removed a “view dropped” message is displayed. DROP VIEW view name; REMOVING A VIEW
  • 27.  When you alter an underlying table the view becomes invalid. You need to recompile that view to make it valid again. the ALTER VIEW statement is used for the re –compilation of a view. ALTER VIEW deptsalvu COMPILE; ALTERTING A VIEW
  • 28.  A sequence is an oracle object that is used to generate a sequence of number sequencing is a perfect solution for generating values for such numeric columns. A sequence is a not primary key columns but can be used on any numeric column. SEQUENCES
  • 29.  CREATE SEQUENCE sequencename [INCREMENT BY n] [START WITH s] [MAXVALUE x NOMAXVALUE] [MINVALUE m NOMINVALUE] [CYCLE NOCYCLE] [CACHE cNOCACHE] [ORDERNOORDER] syntax
  • 30.   Modify a sequence if you own it or have ALTER SEQUENCE .  Modify sequence does not affect past numbers only generated in the future. Modification of a sequence does not allow you to change the starting value.  The maximum value cannot be set to a number less than the current number. MODIFYING A SEQUENCE
  • 31.  ALTER SEQUENCE sequencename [INCREMENT BY n] [MAXVALUE x NOMAXVALUE] [MINVALUE m NOMINVALUE] [CYCLENOCYCLE] [CACHE cNOCACHE] [ORDERNOORDER]; syntax
  • 32.  You can drop a sequence with the DROP SEQUENCE statement. A removed sequence cannot be used anymore. DROPSEQUENCE major Majorid seq; DROPPING A SEQUENCE
  • 33.   synonyms are oracle objects that are used to create alternative names for tables ,views , sequnces and other objects.  you can create a synonyms for username .table name  a synonym name must be different than all than the other objects owned by the user.  A synonym can be removed by using the DROP SYNONYM statement.  A user can get information about synonyms and their table names by using oracle data dictionary table , USER SYNONYMS SYNONYMS
  • 34.  An index is another oracle object that is used for faster retrieval of rows from a table. an index can be created explicitly by using the CREATE INDEX statement or implicitly by oracle. INDEX
  • 35.   An index based on a combined of column is called  composite index or CONCATENATED INDEX.  The general syntax is : CREATE INDEX index name ON tablename(columnname1,[columnname2],…);  The TABLESPACE and STORAGE clause can be used  with the CREATE INDEX statement.
  • 36.  When a table goes through many changes (insertions, delections,and updates), it is advisable to rebuild indexes based on that table.  You can drop an index and recreate it, but it is faster to just rebuild an existing index.  Rebuild compacts index data and improves performance.  For example, ALTER INDEX student_ index REBUILD; REBUILDING AN INDEX
  • 37. A user’s access needs to be controlled in a shared, multiuser oracle environment. A user’s access to the database can be restricted, and a user may or may not be allowed to use certain objects in the database. Security is classified into two types: SYSTEM SECURITY DATABASE SECURITY CONTROLLING ACCESSS
  • 38.  Defines access to the database at the system level. It is implemented by assigning a username and password, allocating disk space, and providing a user with the ability to perform system operations. SYSTEM SECURITY
  • 39. Defines a user’s access to various objects' and the tasks a user can perform on them. The database administrator[DBA]is the most trusted user ,and a DBA is the most trusted user, and a DBA has all the privileges. A DBA can create users, assign them. Database security
  • 40.  An object privileges specifies what a user can do with a database object, such as a table, sequence, or a view.  There are 11 basic object privileges, and each object has a set of privileges out of the total of 11 privileges. OBJECT PRIVILEGES