Dumies collection

Page 15

Table of Contents UNIQUE ................................................................................................189 DISTINCT .............................................................................................189 OVERLAPS ...........................................................................................190 MATCH .................................................................................................190 Referential integrity rules and the MATCH predicate....................192 Logical Connectives.....................................................................................194 AND ......................................................................................................194 OR .........................................................................................................195 NOT ......................................................................................................195 GROUP BY Clauses.......................................................................................196 HAVING Clauses............................................................................................197 ORDER BY Clauses.......................................................................................198

Chapter 10: Using Relational Operators . . . . . . . . . . . . . . . . . . . . . . . .201 UNION ............................................................................................................201 The UNION ALL operation.................................................................203 The CORRESPONDING operation .....................................................203 INTERSECT....................................................................................................204 EXCEPT..........................................................................................................205 Various Joins.................................................................................................206 Basic join .............................................................................................206 Equi-join...............................................................................................208 Cross join.............................................................................................210 Natural join..........................................................................................210 Condition join .....................................................................................211 Column-name join ..............................................................................211 Inner join .............................................................................................212 Outer join ............................................................................................213 Union join ............................................................................................216 ON versus WHERE........................................................................................223

Chapter 11: Delving Deep with Nested Queries . . . . . . . . . . . . . . . . .225 What Subqueries Do ....................................................................................226 Nested queries that return sets of rows..........................................227 Nested queries that return a single value .......................................230 The ALL, SOME, and ANY quantifiers ..............................................233 Nested queries that are an existence test.......................................235 Other correlated subqueries ............................................................236 UPDATE, DELETE, and INSERT statements .....................................240

Chapter 12: Recursive Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243 What Is Recursion? ......................................................................................243 Houston, we have a problem ............................................................244 Failure is not an option......................................................................244 What Is a Recursive Query?........................................................................246 Where Might You Use a Recursive Query? ...............................................247 Querying the hard way ......................................................................248 Saving time with a recursive query..................................................249 Where Else Might You Use a Recursive Query? .......................................252

xiii


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.