Download Outline of topics covered in the Advanced SQL series

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Encyclopedia of World Problems and Human Potential wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Tandem Computers wikipedia , lookup

Database wikipedia , lookup

Microsoft Access wikipedia , lookup

Oracle Database wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Clusterpoint wikipedia , lookup

Database model wikipedia , lookup

Relational algebra wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Join (SQL) wikipedia , lookup

Null (SQL) wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Relational model wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Transcript
SQL Advanced1 Features
Prepared by Jennifer Kreie, Associate Professor
Accounting & Information Systems Department
College of Business, New Mexico State University
Databases used in this SQL series:
 Human Resources – This is a pre-existing database provided by Oracle when you install Oracle XE.
 Student-Teams – This database was created in the SQL Fundamentals series. The DIVISION lesson
adds two tables to this database and includes the data.
Presentation topics:
1 /6
SQL Advanced – Equi-join, one-sided outer join, full outer join, IS NULL. Assignment included.
2 /6
SQL Advanced – Nested queries: Type I subquery. Assignment included. Assignment included.
3 /6
SQL Advanced – Nested queries: Type II subquery (correlated) and example of a DIFFERENCE
problem. Assignment included.
4 /6
SQL Advanced – In-line query in the FROM clause. Assignment included.
5 /6
SQL Advanced – Nested aggregates. Assignment included.
6 /6
SQL Advanced – Division problems. Assignment included.
Outline of topics covered in each lesson.
SQL Advanced – Equi-join, one-sided outer join, full outer join, IS NULL.
 Equi-join
 One-sided outer join
o Left
o Right
 Full outer join
 One-sided outer join with IS NULL
 Plus notation – one-sided outer joins in the WHERE clause.
 DESC used to reverse the sorted order in the ORDER BY clause.
SQL Advanced – Nested queries: Type I subquery. Assignment included.
 Type I subquery in the WHERE clause.
o The IN/NOT IN operator acts like a join between the outer query and the subquery.
o The inner query doesn’t reference the outer query.
o Do data is displayed directly from the subquery.
 Deleting data using the Type I query.
 A Type I subquery in the HAVING clause.
1
You’re welcome to use this material but please provide a reference to this source.
SQL Advanced – Nested queries: Type II subquery (correlated) and example of a DIFFERENCE problem.
 Type II (correlated) subquery.
 Example of Type I and Type II solutions.
 Solving a “difference” problem with a Type II subquery.
SQL Advanced – In-line query in the FROM clause.
 In-line subquery
o Use in decomposing a problem and writing queries for each subquery. This can also help in
debugging or troubleshooting a query.
SQL Advanced – Nested aggregates.
 Nested aggregate queries
 When do you need a nested aggregate?
o Whenever you find yourself trying to do a function within a function, such as an average of a
sum, you probably need a nested aggregate query.
SQL Advanced – Division problems.
 Division-type problems
 No DIVISION operator
 Work-around for answering a “division” question.