The Practical SQL Handbook : Using Structured Query Language / Edition 3

The Practical SQL Handbook : Using Structured Query Language / Edition 3

by Judith S. Bowman, Sandra L. Emerson, Marcy Darnovsky
     
 

ISBN-10: 0201447878

ISBN-13: 9780201447873

Pub. Date: 10/09/1996

Publisher: Addison Wesley Professional

is really used is updated to reflect the growth of the database market, as well as the latest ANSI SQL standard and other important developments. The CD-ROM includes Sybase SQL Anywhere Desktop Runtime, a full-featured SQL database that gives readers hands-on SQL programming experience.

Overview

is really used is updated to reflect the growth of the database market, as well as the latest ANSI SQL standard and other important developments. The CD-ROM includes Sybase SQL Anywhere Desktop Runtime, a full-featured SQL database that gives readers hands-on SQL programming experience.

Product Details

ISBN-13:
9780201447873
Publisher:
Addison Wesley Professional
Publication date:
10/09/1996
Edition description:
Older Edition
Pages:
496
Product dimensions:
7.22(w) x 9.18(h) x 1.19(d)

Table of Contents


FOREWORD by Robert Epstein ..... ix

PREFACE TO THE SECOND AND THIRD EDITIONS ..... xiii

ACKNOWLEDGMENTS ..... xv

INTRODUCTION ..... xvii

CHPATER 1: SQL AND RELATIONAL DATABASE MANAGEMENT ..... 1

Relational Database Management ..... 1
Beginning Database Design ..... 15

CHAPTER 2: DESIGNING DATABASES ..... 17

Database Design ..... 17
Data Entries and Relationships ..... 24
The Normalization Guidelines ..... 34
Reviewing the Database ..... 41
Implementing the Design ..... 45

CHAPTER 3: CREATING AND FILLING A DATABASE ..... 47

Creating Databases and Objects with SQL ..... 47
SQL Syntax ..... 47
Creating Databases ..... 51
Creating Tables ..... 54
Creating Indexes ..... 62
Creating Tables with SQL-92 Constraints ..... 66
Changing and Deleting Databases and Objects ..... 72
Adding, Changing, and Removing Data ..... 75
Changing Existing Data: UPDATE ..... 81
Removing Data: DELETE ..... 85
Beginning Data Retrieval ..... 86

CHAPTER 4: SELECTING DATA FROM THE DATABASE ..... 87

Among the Select? ..... 87
Choosing Columns: The Select List ..... 91
Specifying Tables: The Table List ..... 104
Selecting Rows: The WHERE Clause ..... 105
And There's More ..... 130

CHAPTER 5: SORTING DATA AND OTHER SELECTION TECHNIQUES ..... 131

A New Batch of SELECT Statement Clauses ..... 131
Sorting Query Results: ORDER BY ..... 131
Eliminating Duplicate Rows: DISTINCT and ALL ..... 142
Aggregate Functions ..... 149
Scalar and Vector Aggregates ..... 161

CHAPTER 6: GROUPINGDATA AND REPORTING FROM IT ..... 163

Grouping ..... 163
The GROUP BY Clause ..... 163
The HAVING Clause ..... 180
More on Nulls ..... 185
Working with Multiple Tables ..... 192

CHAPTER 7: JOINING TABLES FOR COMPREHENSIVE DATA ANALYSIS ..... 193

What Is a Join? ..... 193
Why Joins Are Necessary ..... 194
A Preliminary Join Example ..... 196
How to Get a Good Join ..... 197
Improving and Readability of Join Results ..... 198
Specifying Join Conditions ..... 201
How the System Processes Joins ..... 214
Unions ..... 217
Diving into Subqueries ..... 222

CHAPTER 8: STRUCTURING QUERIES WITH SUBQUERIES ..... 223

What Is Subquery? ..... 223
How Do Subqueries Work? ..... 224
Joins or Subqueries? ..... 228
Subquery Rules ..... 231
Subqueries Returning Zero or More Values ..... 232
Subqueries Returning a Single Value ..... 246
Subqueries Testing Existence ..... 250
Subqueries in Multiple Levels of Nesting ..... 255
Subqueries in UPDATE, DELETE, and INSERT Statements ..... 256
On to Views ..... 257

CHAPTER 9: CREATING AND USING VIEWS ..... 259

With a View toward Flexibility ..... 259
Creating Views ..... 260
Advantages of Views ..... 261
How Views Work ..... 267
Data Modification through Views ..... 278
Creating Copies of Data ..... 281
Database Administration Issues ..... 283

CHAPTER 10: SECURITY, TRANSACTIONS, PERFORMANCE, AND INTEGRITY ..... 285

Database Management in the Real World ..... 285
Data Security ..... 286
Transactions ..... 295
Performance ..... 300
Data Integrity ..... 305
From Generic SQL to the Real World ..... 313

CHAPTER 11: SOLVING BUSINESS PROBLEMS ..... 315

Using SQL on the Job ..... 315
Formatting and Displaying Data ..... 316
Plying with Patterns ..... 327
Finding Data with Complex Joins and Subqueries ..... 336
GROUP BY ..... 346
Sequential Numbers ..... 347
Avoiding Mistakes ..... 351

CHAPTER 12: MISTAKES AND HOW TO AVOID THEM ..... 353

No, You're Not Stupid ..... 353
GROUP BY ..... 354
WHERE and HAVING ..... 355
DISTINCT ..... 368
Other Mix-ups ..... 373

APPENDIX A. SYNTAX SUMMARY FOR THE SQL USED IN T

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >