nn
CHAPTER 7: AD g g
VANCEDSQL g
Essentials of Database Management
g nn g nn g nn
Jeffrey A. Hoffer, Heikki Topi, V. Ramesh
g g g g g g
Copyright © 2014 Pearson Education, Inc.
g g g g g
1
, Stuvia.com --The
TheMarketplace
Marketplaceto to
nn nn nn BuyBuy
andand
Sell Sell
nn youryour
StudyStudy
nn Material
nn Material
nn nn nn nn
OBJECTIVES
◻ Define terms
g g
◻ Write single and multiple table SQL queries
g g g g g g g
◻ Define and use three types of joins
gnn g g g g g g
◻ Write noncorrelated and correlated subqueries
g g g g g
◻ Understand and use SQL in procedural language
g g g g g g g
s (e.g. PHP, PL/SQL)
g g g
◻ Understand triggers and stored procedures
g g g g g
2
Chapter 7 g Copyright © 2014 Pearson Education, Inc.
g g g g g
, Stuvia.com --The
TheMarketplace
Marketplaceto to
nn nn BuyBuy
nn andand
Sell Sell
youryour
StudyStudy
nn Material
Material
nn nn nn nn nn nn
g g
◻ Join–
g
a relational operation that causestwo or more tables with
nn g g g g g g g g g g
a common domain to be combined into a single table or vi
n n g g g g g g g g g g g
ew nn
◻ Equi-join–
g
a join in which the joining condition is based on equality b
nn g g g g g g g g g g g
etween values in the common columns; common colum
nn g g g g g g g
ns appear redundantly in the result table
nn g g g g g g
◻Natural join–an equi-
g g g
join in which one of the duplicate columns is eliminated in
nn g g g g g g g g g g g
the result table
n n g g
The common columns in joined tables are usually the primary key of t
g g g g g g g g g g g g
he dominant table and the foreign key of the dependent table in 1:M rel
nn g g g g g g g g g g g g g
ationships nn
, Chapter7
n
Copyright © 2014 Pearson Education, Inc.
g g g g g 3
CHAPTER 7: AD g g
VANCEDSQL g
Essentials of Database Management
g nn g nn g nn
Jeffrey A. Hoffer, Heikki Topi, V. Ramesh
g g g g g g
Copyright © 2014 Pearson Education, Inc.
g g g g g
1
, Stuvia.com --The
TheMarketplace
Marketplaceto to
nn nn nn BuyBuy
andand
Sell Sell
nn youryour
StudyStudy
nn Material
nn Material
nn nn nn nn
OBJECTIVES
◻ Define terms
g g
◻ Write single and multiple table SQL queries
g g g g g g g
◻ Define and use three types of joins
gnn g g g g g g
◻ Write noncorrelated and correlated subqueries
g g g g g
◻ Understand and use SQL in procedural language
g g g g g g g
s (e.g. PHP, PL/SQL)
g g g
◻ Understand triggers and stored procedures
g g g g g
2
Chapter 7 g Copyright © 2014 Pearson Education, Inc.
g g g g g
, Stuvia.com --The
TheMarketplace
Marketplaceto to
nn nn BuyBuy
nn andand
Sell Sell
youryour
StudyStudy
nn Material
Material
nn nn nn nn nn nn
g g
◻ Join–
g
a relational operation that causestwo or more tables with
nn g g g g g g g g g g
a common domain to be combined into a single table or vi
n n g g g g g g g g g g g
ew nn
◻ Equi-join–
g
a join in which the joining condition is based on equality b
nn g g g g g g g g g g g
etween values in the common columns; common colum
nn g g g g g g g
ns appear redundantly in the result table
nn g g g g g g
◻Natural join–an equi-
g g g
join in which one of the duplicate columns is eliminated in
nn g g g g g g g g g g g
the result table
n n g g
The common columns in joined tables are usually the primary key of t
g g g g g g g g g g g g
he dominant table and the foreign key of the dependent table in 1:M rel
nn g g g g g g g g g g g g g
ationships nn
, Chapter7
n
Copyright © 2014 Pearson Education, Inc.
g g g g g 3