BN.com Gift Guide

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

Paperback (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 96%)
Other sellers (Paperback)
  • All (9) from $1.99   
  • New (1) from $32.95   
  • Used (8) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$32.95
Seller since 2014

Feedback rating:

(28)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
NEW -- Paperback with Sealed CD --Ships within 24 hours from USA with FREE USPS Delivery Tracking

Ships from: The Woodlands, TX

Usually ships in 1-2 business days

  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Page 1 of 1
Showing All
Close
Sort by

Overview

In the past few years, SQL has evolved from a language known only to computer specialists to a widely used, international standard of the computer industry. The number of SQL-compatible databases shipping each year now totals in the millions. If you are accessing corporate information from the Internet or from an internal network, you are probably using SQL. SQL Queries for Mere Mortals will help new users learn the foundations of SQL queries, and will prove an essential reference guide for intermediate and advanced users. The accompanying CD contains five sample databases used for the example queries throughout the book, plus an evaluation copy of Microsoft SQL Server version 7.



0201433362B04062001

Read More Show Less

Editorial Reviews

From Barnes & Noble
Our Review
If your mom didn't raise you to write SQL queries but you've got to do it anyway, we've got your book. SQL Queries for Mere Mortals explains SQL so anyone can understand it -- and write queries that actually deliver the answers they're looking for.

The authors focus entirely on the art of writing end-user queries with SQL, avoiding the "serious" database programming topics that most SQL books focus on. And they use generic SQL that should work on virtually any contemporary database, from Access to Oracle.

You'll start by learning what SQL does and how it interacts with relational databases. Next, you'll start writing simple SELECT statements, learn how to refine them, and master techniques for returning more than simple columns and for using WHERE to filter your data.

Since you'll typically have to draw data from multiple tables, SQL Queries for Mere Mortals explains how to do so, simply and clearly. Hernandez and Viescas thoroughly demystify unions, inner and outer joins, and subqueries and offer practical techniques for grouping, totaling, and summarizing data. Every chapter contains plenty of examples and ends with practice exercises.

Simply put, this book is a life raft for anyone who must ferret accurate data out of an SQL database without formal training.

Booknews
This introduction to the Structured Query Language (SQL) covers the mathematical model for database systems, the SELECT statement, creating expressions, sorting information with an ORDER BY clause, working with multiple tables, and summarizing and grouping data. The CD-ROM contains five sample databases and an evaluation copy of Microsoft SQL Server version 7. Annotation c. Book News, Inc., Portland, OR (booknews.com)
Read More Show Less

Product Details

  • ISBN-13: 9780201433364
  • Publisher: Addison-Wesley
  • Publication date: 8/21/2000
  • Series: For Mere Mortals
  • Edition description: Older Edition
  • Pages: 528
  • Product dimensions: 7.00 (w) x 9.18 (h) x 0.95 (d)

Meet the Author

Michael J. Hernandez is a program manager for the Visual Studio .NET group at Microsoft, and is a veteran relational database developer with more than fourteen years of experience. He has been a premiere instructor with training organizations such as AppDev Training Co., Focal Point, Inc., and Deep Training, and was one of the first two hundred Microsoft-authorized .NET instructors. He speaks regularly at conferences.

John L. Viescas is President of Viescas Consulting, Inc., a respected provider of database consulting services. He is also the author of the best-selling Running Microsoft Access 2000 and Programmer's Quick Reference Guide to SQL.



0201433362AB02032003
Read More Show Less

Read an Excerpt

PREFACE: "Language is by its very nature a communal thing; that is, it expresses never the exact thing but a compromise--that which is common to you, me, and everybody."
--Thomas Earnest Hulme, Speculations

Learning how to retrieve information from a database is commonly a perplexing exercise. However, it can be a relatively easy task--as long as you understand the question you're posing to the database. Once you understand the question, you can translate it into the language used by any database system, which in most cases is Structured Query Language (SQL). You have to translate your request into an SQL statement so that your database system knows what information you want to retrieve. SQL provides the means for you and your database system to communicate with each other.

Throughout our many years as database consultants, we've found that the number of people who merely need to retrieve information from a database far outnumber those who are charged with the task of creating programs and applications for a database. Unfortunately, no books focus solely on the subject of retrieving information, particularly from a "mere mortals" viewpoint. There are numerous good books on SQL, to be sure, but most are targeted toward database programming and development.

With this in mind, we decided it was time to write a book that would help people learn how to query a database properly and effectively. The result of our decision is in your hands. This book is unique among SQL books in that it focuses only on the querying portion of SQL. When you finish reading this book, you'll have the skills you need toretrieve any information you require.

Writing a book such as this is always a cooperative effort. There are always editors, colleagues, friends, and relatives willing to lend their support and provide valuable advice when we need it the most. These folks continually provide us with encouragement, help us to remain focused, and motivate us to see this project through to the end.

First and foremost, we want to thank our editor, Mary O'Brien, for the opportunity to write this book. She saw the potential of an idea we had and pursued it with great dedication. We'd also like to thank Mary and her assistant, Mariann Kourafas, for their great patience and unwavering support throughout the many months we were writing this book. And we can't forget Marilyn Rash and the production staff--great job, guys!

Next, we'd like to acknowledge our technical editors Malcom C. Rubel, Michael Blaha, Alexander Tarasul, and Keith W. Hare. Malcom, as always, it's great to have you on the team! Michael and Alexander, thanks for all your thoughtful comments and suggestions. And a special thanks to Keith--he corrected a few minor errors we had in the SQL history timeline and provided much of the information for the What the Future Holds section of Chapter 3. Thanks once again to all of you for your time and input and for helping us to make this a solid treatise on SQL queries.

Finally, a very special thanks to Joe Celko for providing the Foreword. Joe is an SQL expert, a colleague, and a good friend. We have a lot of respect for Joe's knowledge and expertise on the subject, and we're pleased to have his thoughts and comments at the beginning of our book.

Michael J. Hernandez
& John L. Viescas

I want to give my most sincere thanks to my dear friend and colleague, John L. Viescas, for the opportunity of co-authoring this book with him. It was John who had the initial idea for this book, and over dinner one evening he talked me into writing it with him. John has been in the business a long time and is an established, respected author. It is my honor to share authorship with him on this work.

Finally, I want to thank my wife Kendra. Once again, she has exhibited extreme patience while I toiled away at my writing. Her help has been invaluable, and yet again, I owe her a great debt. I would tell you that she is the love of my life, my closest confidant, and my best friend, but she abhors any sort of public displays of affection. (She refers to this as PDA.) So I'll just end with this:

Well, Ked, we can resume a normal life again--until the next book!

Michael J. Hernandez
Bellevue, Washington


Gee, Mike! Are you trying to give me a big head or something? You're not such a slouch yourself. I may have talked you into doing the "next" Mere Mortals book on SQL, but you're the one who invented the now well-proven format and "voice" for this audience. It has been a fun and interesting task bringing the complex world of SQL (one of my favorite subjects) to such a wide audience. Thanks for letting me in on the project.

Unlike yours, my wife, Suzanne, does not abhor PDAs. We both owe her a big hug--not just for putting up with me while I was "offline" doing this book but also for providing excellent behind-the-scenes editing and critical commentary of our material. She's no stranger when it comes to computers, but she's definitely a "mere mortal" when it comes to databases. She provided a perfect audience to test the draft chapters. I only had to make her one promise: I'm leaving my laptop home this spring on our next trip to Hawaii!

John I. Viescas
Austin, Texas



0201433362P04062001
Read More Show Less

Table of Contents



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".

I. RELATIONAL DATABASES AND SQL.

1. 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?"

2. 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 ofParticipation.

Is That All?

3. A Concise History of SQL.

Topics Covered in This Chapter.

The Origins of SQL.

Early Vendor Implementation.

". . . 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?

II. SQL BASICS.

4. 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.

Problems for You to Solve.

5. 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.

Problems for You to Solve.

6. 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.

Problems for You to Solve.

III. WORKING WITH MULTIPLE TABLES.

7. 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.

8. 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.

Problems for You to Solve.

9. 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.

Problems for You to Solve.

10. 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.

Problems for You to Solve.

11. 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.

Problems for You to Solve.

IV. SUMMARIZING AND GROUPING DATA.

12. Summarizing Data.

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.

Problems for You to Solve.

13. 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.

Problems for You to Solve.

14. 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.

Problems for You to Solve.

In Closing.

APPENDICES.

A. SQL Standard Diagrams.

B. Schema for the Sample Databases.

C. Recommended Reading References.

Index. 0201433362T04062001

Read More Show Less

Preface

"Language is by its very nature a communal thing; that is, it expresses never the exact thing but a compromise—that which is common to you, me, and everybody."
—Thomas Earnest Hulme, Speculations

Learning how to retrieve information from a database is commonly a perplexing exercise. However, it can be a relatively easy task—as long as you understand the question you're posing to the database. Once you understand the question, you can translate it into the language used by any database system, which in most cases is Structured Query Language (SQL). You have to translate your request into an SQL statement so that your database system knows what information you want to retrieve. SQL provides the means for you and your database system to communicate with each other.

Throughout our many years as database consultants, we've found that the number of people who merely need to retrieve information from a database far outnumber those who are charged with the task of creating programs and applications for a database. Unfortunately, no books focus solely on the subject of retrieving information, particularly from a "mere mortals" viewpoint. There are numerous good books on SQL, to be sure, but most are targeted toward database programming and development.

With this in mind, we decided it was time to write a book that would help people learn how to query a database properly and effectively. The result of our decision is in your hands. This book is unique among SQL books in that it focuses only on the querying portion of SQL. When you finish reading this book, you'll have the skills youneed to retrieve any information you require.

Writing a book such as this is always a cooperative effort. There are always editors, colleagues, friends, and relatives willing to lend their support and provide valuable advice when we need it the most. These folks continually provide us with encouragement, help us to remain focused, and motivate us to see this project through to the end.

First and foremost, we want to thank our editor, Mary O'Brien, for the opportunity to write this book. She saw the potential of an idea we had and pursued it with great dedication. We'd also like to thank Mary and her assistant, Mariann Kourafas, for their great patience and unwavering support throughout the many months we were writing this book. And we can't forget Marilyn Rash and the production staff—great job, guys!

Next, we'd like to acknowledge our technical editors Malcom C. Rubel, Michael Blaha, Alexander Tarasul, and Keith W. Hare. Malcom, as always, it's great to have you on the team! Michael and Alexander, thanks for all your thoughtful comments and suggestions. And a special thanks to Keith—he corrected a few minor errors we had in the SQL history timeline and provided much of the information for the What the Future Holds section of Chapter 3. Thanks once again to all of you for your time and input and for helping us to make this a solid treatise on SQL queries.

Finally, a very special thanks to Joe Celko for providing the Foreword. Joe is an SQL expert, a colleague, and a good friend. We have a lot of respect for Joe's knowledge and expertise on the subject, and we're pleased to have his thoughts and comments at the beginning of our book.

Michael J. Hernandez
& John L. Viescas

I want to give my most sincere thanks to my dear friend and colleague, John L. Viescas, for the opportunity of co-authoring this book with him. It was John who had the initial idea for this book, and over dinner one evening he talked me into writing it with him. John has been in the business a long time and is an established, respected author. It is my honor to share authorship with him on this work.

Finally, I want to thank my wife Kendra. Once again, she has exhibited extreme patience while I toiled away at my writing. Her help has been invaluable, and yet again, I owe her a great debt. I would tell you that she is the love of my life, my closest confidant, and my best friend, but she abhors any sort of public displays of affection. (She refers to this as PDA.) So I'll just end with this:

Well, Ked, we can resume a normal life again—until the next book!

Michael J. Hernandez
Bellevue, Washington


Gee, Mike! Are you trying to give me a big head or something? You're not such a slouch yourself. I may have talked you into doing the "next" Mere Mortals book on SQL, but you're the one who invented the now well-proven format and "voice" for this audience. It has been a fun and interesting task bringing the complex world of SQL (one of my favorite subjects) to such a wide audience. Thanks for letting me in on the project.

Unlike yours, my wife, Suzanne, does not abhor PDAs. We both owe her a big hug—not just for putting up with me while I was "offline" doing this book but also for providing excellent behind-the-scenes editing and critical commentary of our material. She's no stranger when it comes to computers, but she's definitely a "mere mortal" when it comes to databases. She provided a perfect audience to test the draft chapters. I only had to make her one promise: I'm leaving my laptop home this spring on our next trip to Hawaii!

John I. Viescas
Austin, Texas



Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 2 Customer Reviews
  • Anonymous

    Posted November 19, 2001

    A Lifesaver

    Four months ago I had never heard of SQL and now I am writing queries like an old pro thanks to this book. It is very user friendly and easy to understand. Definitely worth the money!!!!

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted October 25, 2000

    SQL Language made VERY EASY!!!

    I'm required to learn basic SQL for a Masters in E-Commerce, and the book we use really stinks. This book cleared up basic concepts I had been struggling with all year long, in a matter of minutes. A MUST HAVE for self-educators and a MUST USE for colleges and universities.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 2 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)