| |
| |
Introduction | |
| |
| |
Who Is This Book For? | |
| |
| |
Companion Website | |
| |
| |
Conventions Used in This Book | |
| |
| |
| |
Understanding SQL | |
| |
| |
Database Basics | |
| |
| |
What Is SQL? | |
| |
| |
Try It Yourself | |
| |
| |
| |
Introducing MySQL | |
| |
| |
What Is MySQL? | |
| |
| |
MySQL Tools | |
| |
| |
| |
Working with MySQL | |
| |
| |
Making the Connection | |
| |
| |
Selecting a Database | |
| |
| |
Learning About Databases and Tables | |
| |
| |
| |
Retrieving Data | |
| |
| |
The SELECT Statement | |
| |
| |
Retrieving Individual Columns | |
| |
| |
Retrieving Multiple Columns | |
| |
| |
Retrieving All Columns | |
| |
| |
Retrieving Distinct Rows | |
| |
| |
Limiting Results | |
| |
| |
Using Fully Qualified Table Names | |
| |
| |
| |
Sorting Retrieved Data | |
| |
| |
Sorting Data | |
| |
| |
Sorting by Multiple Columns | |
| |
| |
Specifying Sort Direction | |
| |
| |
| |
Filtering Data | |
| |
| |
Using the WHERE Clause | |
| |
| |
The WHERE Clause Operators | |
| |
| |
| |
Advanced Data Filtering | |
| |
| |
Combining WHERE Clauses | |
| |
| |
Using the IN Operator | |
| |
| |
Using the NOT Operator | |
| |
| |
| |
Using Wildcard Filtering | |
| |
| |
Using the LIKE Operator | |
| |
| |
Tips for Using Wildcards | |
| |
| |
| |
Searching Using Regular Expressions | |
| |
| |
Understanding Regular Expressions | |
| |
| |
Using MySQL Regular Expressions | |
| |
| |
| |
Creating Calculated Fields | |
| |
| |
Understanding Calculated Fields | |
| |
| |
Concatenating Fields | |
| |
| |
Performing Mathematical Calculations | |
| |
| |
| |
Using Data Manipulation Functions | |
| |
| |
Understanding Functions | |
| |
| |
Using Functions | |
| |
| |
| |
Summarizing Data | |
| |
| |
Using Aggregate Functions | |
| |
| |
Aggregates on Distinct Values | |
| |
| |
Combining Aggregate Functions | |
| |
| |
| |
Grouping Data | |
| |
| |
Understanding Data Grouping | |
| |
| |
Creating Groups | |
| |
| |
Filtering Groups | |
| |
| |
Grouping and Sorting | |
| |
| |
SELECT Clause Ordering | |
| |
| |
| |
Working with Subqueries | |
| |
| |
Understanding Subqueries | |
| |
| |
Filtering by Subquery | |
| |
| |
Using Subqueries As Calculated Fields | |
| |
| |
| |
Joining Tables | |
| |
| |
Understanding Joins | |
| |
| |
Creating a Join | |
| |
| |
| |
Creating Advanced Joins | |
| |
| |
Using Table Aliases | |
| |
| |
Using Different Join Types | |
| |
| |
Using Joins with Aggregate Functions | |
| |
| |
Using Joins and Join Conditions | |
| |
| |
| |
Combining Queries | |
| |
| |
Understanding Combined Queries | |
| |
| |
Creating Combined Queries | |
| |
| |
| |
Full-Text Searching | |
| |
| |
Understanding Full-Text Searching | |
| |
| |
Using Full-Text Searching | |
| |
| |
| |
Inserting Data | |
| |
| |
Understanding Data Insertion | |
| |
| |
Inserting Complete Rows | |
| |
| |
Inserting Multiple Rows | |
| |
| |
Inserting Retrieved Data | |
| |
| |
| |
Updating and Deleting Data | |
| |
| |
Updating Data | |
| |
| |
Deleting Data | |
| |
| |
Guidelines for Updating and Deleting Data | |
| |
| |
| |
Creating and Manipulating Tables | |
| |
| |
Creating Tables | |
| |
| |
Updating Tables | |
| |
| |
Deleting Tables | |
| |
| |
Renaming Tables | |
| |
| |
| |
Using Views | |
| |
| |
Understanding Views | |
| |
| |
Using Views | |
| |
| |
| |
Working with Stored Procedures | |
| |
| |
Understanding Stored Procedures | |
| |
| |
Why Use Stored Procedures | |
| |
| |
Using Stored Procedures | |
| |
| |
| |
Using Cursors | |
| |
| |
Understanding Cursors | |
| |
| |
Working with Cursors | |
| |
| |
| |
Using Triggers | |
| |
| |
Understanding Triggers | |
| |
| |
Creating Triggers | |
| |
| |
Dropping Triggers | |
| |
| |
Using Triggers | |
| |
| |
| |
Managing Transaction Processing | |
| |
| |
Understanding Transaction Processing | |
| |
| |
Controlling Transactions | |
| |
| |
| |
Globalization and Localization | |
| |
| |
Understanding Character Sets and Collation Sequences | |
| |
| |
Working with Character Set and Collation Sequences | |
| |
| |
| |
Managing Security | |
| |
| |
Understanding Access Control | |
| |
| |
Managing Users | |
| |
| |
| |
Database Maintenance | |
| |
| |
Backing Up Data | |
| |
| |
Performing Database Maintenance | |
| |
| |
Diagnosing Startup Problems | |
| |
| |
Review Log Files | |
| |
| |
| |
Improving Performance | |
| |
| |
Improving Performance | |
| |
| |
| |
Getting Started with MySQL | |
| |
| |
What You'll Need | |
| |
| |
Obtaining the Software | |
| |
| |
Installing the Software | |
| |
| |
Preparing for Your Chapters | |
| |
| |
| |
The Example Tables | |
| |
| |
Understanding the Sample Tables | |
| |
| |
Creating the Sample Tables | |
| |
| |
| |
MySQL Statement Syntax | |
| |
| |
ALTER TABLE | |
| |
| |
COMMIT | |
| |
| |
CREATE INDEX | |
| |
| |
CREATE PROCEDURE | |
| |
| |
CREATE TABLE | |
| |
| |
CREATE USER | |
| |
| |
CREATE VIEW | |
| |
| |
DELETE | |
| |
| |
DROP | |
| |
| |
INSERT | |
| |
| |
INSERT SELECT | |
| |
| |
ROLLBACK | |
| |
| |
SAVEPOINT | |
| |
| |
SELECT | |
| |
| |
START TRANSACTION | |
| |
| |
UPDATE | |
| |
| |
| |
MySQL Datatypes | |
| |
| |
String Datatypes | |
| |
| |
Numeric Datatypes | |
| |
| |
Date and Time Datatypes | |
| |
| |
Binary Datatypes | |
| |
| |
| |
MySQL Reserved Words | |
| |
| |
Index | |