Practical SQL Handbook, The: Using SQL Variants, Fourth Edition
Read it now on the O’Reilly learning platform with a 10-day free trial.
O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Book description
This latest edition of the best-selling implementation guide to the Structured Query Language teaches SQL fundamentals while providing practical solutions for critical business applications. The Practical SQL Handbook, Fourth Edition now includes expanded platform SQL coverage and extensive real-world examples based on feedback from actual SQL users.
The Practical SQL Handbook begins with a step-by-step introduction to SQL basics and examines the issues involved in designing SQL-based database applications. It fully explores SQL’s most popular implementations from industry leaders, Oracle, Microsoft, Sybase, and Informix.
A bonus CD-ROM contains a time-limited, full-feature version of the Sybase® Adaptive Server Anywhere™ software as well as the sample database, scripts, and examples included in the book.
The Practical SQL Handbook is the most complete reference available for day-to-day SQL implementations.
Show and hide more
Table of contents Product information
Table of contents
- Copyright
- Dedication
- Why New Editions?
- Changes for Recent Editions
- The Fourth Edition
- Acknowledgments
- The Beginnings of SQL
- The Commercialization of SQL
- Who Should Use This Book
- The Focus of This Book
- How to Learn SQL with This Book
- Relational Database Management
- The Relational Model: It's All Tables
- Independence Forever
- A High-Level Language
- Data Manipulation
- Data Definition
- Data Administration
- Projection
- Selection
- Join
- Design Considerations
- Do You Need an Expert?
- Data Definition and Customization
- How to Approach Database Design
- Introducing the Sample Database
- Entities: Things with an Independent Existence
- One-to-Many Relationships
- Many-to-Many Relationships
- One-to-One Relationships
- The Entity-Relationship Approach Summarized
- First Normal Form
- Second Normal Form
- Third Normal Form
- Fourth Normal Form
- Summarizing the bookbiz Database
- Testing Your Database Design
- Other Database Definition Considerations
- From Theory to Practice: Installing bookbiz
- Distinguishing SQL Examples and Syntax
- Coping with Failure
- Getting Started
- Recognizing Roles
- Reserving Space for Database Objects
- Choosing Databases
- Choosing Datatypes
- Assigning NULL and NOT NULL
- Planning Tables
- Defining the Tables in bookbiz
- The CREATE INDEX Statement
- How, What, and Why to Index
- Sketching Constraints
- Implementing Constraints on Individual Columns
- Implementing Multicolumn Constraints
- Changing Databases
- Changing Table Definitions
- Removing Databases
- Removing Tables
- Removing Indexes
- Adding New Rows: INSERT
- Changing Existing Data: UPDATE
- Removing Data: DELETE
- SELECT Overview and Syntax
- Basic SELECT Syntax
- Full SELECT Syntax
- Choosing All Columns: SELECT *
- Choosing Specific Columns
- More Than Column Names
- Using Table Aliases
- Skipping FROM
- Comparison Operators
- Connecting Conditions with Logical Operators
- Ranges (BETWEEN and NOT BETWEEN)
- Lists (IN and NOT IN)
- Selecting Null Values
- Matching Character Strings: LIKE
- Like, Is IN LIKE Equals . . . ?
- A New Batch of SELECT Statement Clauses
- Sorting Query Results: ORDER BY
- ORDER BY Syntax
- Character Sets and Sort Orders
- Sorts Within Sorts
- Sort Up, Sort Down
- What About More Complex Expressions?
- How Do You Sort Nulls?
- DISTINCT Syntax
- DISTINCT with Multiple SELECT List Items
- Aggregate Syntax
- Grouping and Aggregates
- The GROUP BY Clause
- GROUP BY Syntax
- Cautions and Restrictions
- NULLs and Groups
- GROUP BY: Aggregate Interactions
- GROUP BY with WHERE
- GROUP BY and ORDER BY
- Garden-Variety HAVING
- WHERE, GROUP BY, HAVING, ORDER BY
- NULLs and Database Design
- Comparisons Involving NULLs
- NULLs and Computations
- Defaults as Alternatives to NULLs
- Functions That Work with NULLs
- NULL Functions and “What-If” Calculations
- Defining Joins
- Why Joins Are Necessary
- Associating Data from Separate Tables
- Providing Flexibility
- FROM/WHERE Join Syntax
- SQL-92 Join Syntax
- Analyzing a Join
- Avoiding Duplication
- Limiting the Width of the Display
- Using Aliases in the FROM Clause Table/View List
- Joins Based on Equality
- Joins Not Based on Equality
- Joining More Than Two Tables
- Joining a Table with Itself: The Self-Join
- Showing the Background: Outer Joins
- Understanding the Cartesian Product
- Using the Cartesian Product
- Constraining the Cartesian Product
- UNION
- INTERSECT and MINUS
- What Is a Subquery?
- Simplified Subquery Syntax
- Simple Subquery Processing
- Correlated Subquery Processing
- Simple-Correlated Performance Issues
- Subqueries!
- Joins!
- Subqueries vs. Self-Joins?
- Which Is Better?
- Subqueries Introduced with IN
- Subqueries Introduced with NOT IN
- Correlated Subqueries Introduced with IN
- Subqueries Introduced with Comparison Operators and ANY or ALL
- Aggregate Functions Guarantee a Single Value
- GROUP BY and HAVING Must Return a Single Value
- Correlated Subqueries with Comparison Operators
- NOT EXISTS Seeks the Empty Set
- Using EXISTS to Find Intersection and Difference
- EXISTS Alternatives
- Subqueries in the FROM Clause
- Subqueries in the SELECT Clause
- With a View Toward Flexibility
- View Commands
- Creating Views
- Displaying Data Through Views
- Dropping Views
- Focus, Simplification, and Customization
- Security
- Independence
- Naming View Columns
- Creating Views with Multiple Underlying Objects
- Resolving Views
- The Rules According to ANSI
- Database Management in the Real World
- Data Security
- User Identification and Special Users
- The GRANT and REVOKE Commands
- Views as Security Mechanisms
- Transactions and Concurrency
- Transactions and Recovery
- User-Defined Transactions
- Benchmarking
- Design and Indexing
- Optimizing Queries
- Other Tools for Monitoring and Boosting Performance
- Domain Constraints
- Entity Integrity
- Referential Integrity
- Stored Procedures and Triggers
- Using SQL on the Job
- Thinking Conditionally
- CASE/DECODE
- Changing Null Displays
- Displaying One Column as Two
- Displaying Two Columns as One
- Converting from One Datatype to Another
- Matching Uppercase and Lowercase Letters
- Finding Data Within a Range When You Don't Know the Values
- Locating Date Data
- Displaying Data by Time Units
- Distinguishing DISTINCTs
- Removing Duplicates
- Finding the “First” Entry
- Formatting
- Syntax Conventions
- Statement List
- Comparisons
- Naming Convention Comparison
- Datatype Comparison
- Function Comparison
- Character Functions
- Conditional Functions
- Date and Time Functions
- Database Details
- Table Charts
- publishers Table
- authors Table
- titles Table
- titleauthors Table
- sales Table
- salesdetails Table
- editors Table
- titleditors Table
- roysched Table
- Adaptive Server Anywhere CREATEs
- Transact-SQL CREATEs
- Oracle CREATEs
- Informix CREATEs
- Books
- General
- Informix
- Microsoft SQL Server
- mSQL/MySQL
- Oracle
- Sybase
- Transact-SQL
Show and hide more
Product information
- Title: Practical SQL Handbook, The: Using SQL Variants, Fourth Edition
- Author(s): Judith S. Bowman, Marcy Darnovsky, Sandra L. Emerson
- Release date: June 2001
- Publisher(s): Addison-Wesley Professional
- ISBN: 0201703092
You might also like
Check it out now on O’Reilly
Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.