Skip to content

SQL Queries for Mere Mortals A Hands-On Guide to Data Manipulation in SQL

Best in textbook rentals since 2012!

ISBN-10: 0201433362

ISBN-13: 9780201433364

Edition: 2000

Authors: Michael J. Hernandez, John L. Viescas, Joe Celko

List price: $59.99
Blue ribbon 30 day, 100% satisfaction guarantee!
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!

Now there's a practical, hands-on guide to SQL for millions of beginning-to-intermediate database users who desperately need to create fast, accurate, effective queries -- whether they have formal database training or not. The authors begin by introducing the fundamental concepts underlying relational databases and SQL. They then introduce the absolute basics of SQL, including the SELECT statement, creating expressions, and applying filters. Next, they introduce techniques for solving one of the most common problems database users encounter: drawing data from multiple tables at once. The book includes detailed coverage of grouping, totaling, and summarizing data; using SQL to update,…    
Customers also bought

Book details

List price: $59.99
Copyright year: 2000
Publisher: Addison Wesley Professional
Publication date: 8/21/2000
Binding: Paperback
Pages: 528
Size: 7.00" wide x 9.25" long x 1.25" tall
Weight: 1.694
Language: English

John L. Viescas is a database expert who provides consulting and training services to companies around the globe. He is a Microsoft MVP and the author of several popular books, including Microsoft� Office Access� 2003 Inside Out and Building Microsoft� Access� Applications.

Rob Shimonski (www.shimonski.com) is an experienced entrepreneur and an active participant in the business community. Rob is a best-selling author and editor with over 15 years experience developing, producing and distributing print media in the form of books, magazines and periodicals. To date, Rob has successfully created over 100 books that are currently in circulation. Rob has worked for countless companies to include CompTIA, Entrepreneur Magazine, Microsoft, McGraw Hill Education, Cisco, the National Security Agency and Digidesign. Rob has an extremely diverse background in the print media industry filling roles such as author, co-author, technical editor, copy editor and…    

Foreword
Preface and Acknowledgments
About the Authors
Introduction
Are You a "Mere Mortal"?
About This Book
How to Use This Book
Reading the Diagrams Used in This Book
Sample Databases Used in This Book
"Follow the Yellow Brick Road"
Relational Databases and SQL
What Is Relational?
Topics Covered in This Chapter
Types of Databases
A Brief History of the Relational Model
In the Beginning...
Relational Database Software
Anatomy of a Relational Database
Tables
Fields
Records
Keys
Views
Relationships
What's in It for Me?
"Where Do I Go from Here?"
Summary
Ensuring Your Database Structure Is Sound
Topics Covered in This Chapter
Why Is This Chapter Here?
Why Worry about Sound Structures?
Fine-tuning Fields
What's in a Name? (Part One)
Smoothing Out the Rough Edges
Resolving Multipart Fields
Resolving Multivalued Fields
Fine-tuning Tables
What's in a Name? (Part Two)
Ensuring a Sound Structure
Resolving Unnecessary Duplicate Fields
Identification Is the Key
Establishing Solid Relationships
Establishing a Deletion Rule
Setting the Type of Participation
Setting the Degree of Participation
Is That All?
Summary
A Concise History of SQL
Topics Covered in This Chapter
The Origins of SQL
Early Vendor Implementations
"...And Then There Was a Standard"
Evolution of the ANSI/ISO Standard
Other SQL Standards
Commercial Implementations
What the Future Holds
Why Should You Learn SQL?
Summary
SQL Basics
Creating a Simple Query
Topics Covered in This Chapter
Introducing SELECT
The SELECT Statement
Major Clauses in a SELECT Statement
A Quick Aside: Data vs. Information
Translating Your Request into SQL
Expanding the Field of Vision
Eliminating Duplicate Rows
Sorting Information
First Things First: Collating Sequences
Let's Now Come to Order
Saving Your Work
Sample Statements
Summary
Problems for You to Solve
Getting More Than Simple Columns
Topics Covered in This Chapter
The SELECT Clause: Take Two
Specifying Explicit Values
Moving Beyond Basic Information
What Is an Expression?
What Are You Trying to Express?
Data Types in SQL
Types of Expressions
Concatenation
Mathematical
Date and Time Arithmetic
Using Expressions in a SELECT Clause
A Brief Digression: Value Expressions
That "Nothing" Value--NULL
Introducing Null
Sample Statements
Summary
Problems for You to Solve
Filtering Your Data
Topics Covered in This Chapter
Refining What You See Using WHERE
The WHERE Clause
Using a WHERE Clause
Defining Search Conditions
Comparison
Range
Set Membership
Pattern Match
Null
Excluding Rows with NOT
Using Multiple Conditions
Introducing AND and OR
Excluding Rows: Take Two
Order of Precedence
NULLS Revisited: A Cautionary Note
Expressing Conditions in Different Ways
Sample Statements
Summary
Problems for You to Solve
Working with Multiple Tables
Thinking in Sets
Topics Covered in This Chapter
What Is a Set, Anyway?
Operations on Sets
Intersection
Intersection in Set Theory
Intersection between Result Sets
Problems You Can Solve with INTERSECT
Difference
Difference in Set Theory
Difference between Result Sets
Problems You Can Solve with Difference
Union
Union in Set Theory
Combining Result Sets Using UNION
Problems You Can Solve with UNION
SQL Set Operations
"Classical" Set Operations vs. SQL
Finding Common Values--INTERSECT
Finding Missing Values--EXCEPT (DIFFERENCE)
Combining Sets--UNION
Summary
INNER JOINs
Topics Covered in This Chapter
What Is a JOIN?
The INNER JOIN
What's "Legal" to JOIN?
Syntax
Check Those Relationships!
Uses for INNER JOINs
Find Related Rows
Find Matching Values
Sample Statements
Two Tables
More Than Two Tables
Looking for Matching Values
Summary
Problems for You to Solve
OUTER JOINs
Topics Covered in This Chapter
What Is an OUTER JOIN?
The LEFT/RIGHT OUTER JOIN
Syntax
The FULL OUTER JOIN
Syntax
FULL OUTER JOIN on Non-Key Values
Union Join
Uses for OUTER JOINs
Find Missing Values
Find Partially Matched Information
Sample Statements
Summary
Problems for You to Solve
UNIONs
Topics Covered in This Chapter
What Is a UNION?
Writing Requests with UNION
Using Simple SELECT Statements
Combining Complex SELECT Statements
Using UNION More Than Once
Sorting a UNION
Uses for UNION
Sample Statements
Summary
Problems for You to Solve
Subqueries
Topics Covered in This Chapter
What Is a Subquery?
Row Subqueries
Table Subqueries
Scalar Subqueries
Subqueries as Column Expressions
Syntax
An Introduction to Aggregate Functions--COUNT and MAX
Subqueries as Filters
Syntax
Special Predicate Keywords for Subqueries
Uses for Subqueries
Column Expressions
Filters
Sample Statements
Subqueries in Expressions
Subqueries in Filters
Summary
Problems for You to Solve
Summarizing and Grouping Data
Simple Totals
Topics Covered in This Chapter
Aggregate Functions
Counting Rows and Values with COUNT
Computing a Total with SUM
Calculating a Mean Value with AVG
Finding the Largest Value with MAX
Finding the Smallest Value with MIN
Using More Than One Function
Using Aggregate Functions in Filters
Sample Statements
Summary
Problems for You to Solve
Grouping Data
Topics Covered in This Chapter
Why Group Data?
The GROUP BY Clause
Syntax
Mixing Columns and Expressions
Using GROUP BY in a Subquery in a WHERE Clause
Simulating a SELECT DISTINCT Statement
"Some Restrictions Apply"
Column Restrictions
Grouping on Expressions
Uses for GROUP BY
Sample Statements
Summary
Problems for You to Solve
Filtering Grouped Data
Topics Covered in This Chapter
A New Meaning of "Focus Groups"
When You Filter Makes a Difference
Should You Filter in WHERE or in HAVING?
Avoiding the HAVING COUNT Trap
Uses for HAVING
Sample Statements
Summary
Problems for You to Solve
In Closing
Appendices
SQL Standard Diagrams
Schema for the Sample Databases
Recommended Reading References
Index