CHAPTER 4

RELATIONAL DATA RETRIEVAL: SQL

As we move forward into the discussion of database management systems, we will cover a wide range of topics and skills including how to design databases, how to modify database designs to improve performance, how to organize corporate departments to manage databases, and others. But first, to whet your appetites for what is to come, we're going to dive right into one of the most intriguing aspects of database management: retrieving data from relational databases using the industry-standard SQL database management language.

Note: Some instructors may prefer to cover relational data retrieval with SQL after logical database design, Chapter 7, or after physical database design, Chapter 8. This chapter, Chapter 4 on relational data retrieval with SQL, is designed to work just as well in one of those positions as it is here.

OBJECTIVES

  • Write SQL SELECT commands to retrieve relational data using a variety of operators including GROUP BY, ORDER BY, and the built-in functions AVG, SUM, MAX, MIN, COUNT.
  • Write SQL SELECT commands that join relational tables.
  • Write SQL SELECT subqueries.
  • Describe a strategy for writing SQL SELECT statements.
  • Describe the principles of a relational query optimizer.

CHAPTER OUTLINE

Introduction

Data Retrieval with the SQL SELECT Command

  • Introduction to the SQL SELECT Command
  • Basic Functions
  • Built-In Functions
  • Grouping Rows
  • The Join
  • Subqueries
  • A Strategy for Writing SQL SELECT Commands

Example: Good Reading Book ...

Get Fundamentals of Database Management Systems, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.