Cover Page Title Page Copyright Page Preface Page Contents Page Chapter 1 SQL Basics
1.1 What is SQL
1.2 Development History of SQL
1.3 SQL statement
1.4 Data types
1.4.1 Numeric type
1.4.2 Time type
1.4.3 Character type
1.4.4 BLOB type
1.5 Expressions
1.5.1 SQL expression syntax
1.5.2 Column expressions
1.5.3 Constant expressions
1.5.4 Function expression
1.5.5 Group expression
1.5.6 Procedure call expression
1.5.7 Arithmetic operators
1.5.8 Concatenation operator
1.6 Functions
1.6.1 Arithmetic functions
1.6.2 Trigonometric functions
1.6.3 Exponential and logarithmic functions
1.6.4 Date/time functions
1.7 null value
1.8 Summary Chapter 2 Sample Database
2.1 Structure of the sample database
2.1.1 customer table
2.1.2 orders table and items table
2.1.3 stock table and catalog table
2.1.4 cust-calls table
2.1.5 Code table
2.2 Relationships between tables
2.3 Generation of stores7 database
2.4 Data in stores7
2.5 Summary Chapter 3 Simple Query
3.1 select statement
3.2 Basic select statement
3.2.1 Using the asterisk (*)
3.2.2 Order of column names
3.2.3 Remove duplicate rows
3.2.4 Query substring
3.3 Search statement (where clause)
3.3.1 Search conditions
3.3.2 Comparison conditions
3.3.3 Null value judgment
3.3.4 Scope determination
3.3.5 Group membership determination
3.3.6 Pattern matching
3.3.7 Composite conditions
3.4 Calculated columns
3.5 order by clause
3.5.1 Ascending and descending order
3.5.2 Multi-column sorting
3.5.3 Column serial number
3.6 Save query results
3.7 Summary Chapter 4 Multi-table Join Query
4.1 Example of multi-table query
4.2 Simple multi-table connection query
4.2.1 How to construct a multi-table join query
4.2.2 Connection of parent-child relationship tables
4.2.3 Other equivalent connections
4.2.4 Non-equivalent join
4.3 Issues specific to join queries
4.3.1 Ambiguous column names
4.3.2 Multi-table query and Cartesian product
4.3.3 Use of *
4.3.4 Table aliases
4.4 Self-connection
4.4.1 Redundant data
4.4.2 Self-join and into temp clause
4.4.3 Reference rowid value to find duplicate values
4.5 Outer joins
4.5.1 Simple outer join
4.5.2 Nested simple joins
4.5.3 Nested outer joins
4.5.4 Outer join between two tables and the third table
4.6 Summary Chapter 5 Group Statistics
5.1 Group function
5.1.1 What is aggregation function
5.1.2 Using the count function
5.1.3 Using the sum function
5.1.4 Using avg function
5.1.5 Using min function and max function
5.2 Using the group by clause
5.2.1 Understanding the group by clause
5.2.2 Using group functions
5.2.3 Sorting of group results
5.2.4 Some restrictions on grouping
5.3 Using the having clause
5.4 Summary Chapter 6 Subquery
6.1 Using subqueries
6.1.1 What is a subquery
6.1.2 Subquery in where clause
6.1.3 How subqueries are processed
6.2 Subquery application examples
6.2.1 Subquery introduced by in
6.2.2 Subqueries joined by relational operators
6.2.3 Using quantifiers
6.3 Correlated subqueries
6.3.1 Understanding correlated subqueries
6.3.2 Using existential quantifiers
6.4 Subqueries and joins
6.5 Nesting of subqueries
6.6 Subqueries in the having clause
6.7 Summary Chapter 7 Set Operations
7.1 Union operation
7.1.1 Implementation of union
7.1.2 Characteristics of union operation
7.1.3 Application of union operation
7.2 Intersection operation
7.3 Difference operation
7.4 Summary Chapter 8 SQL data update function
8.1 Insert data into the table
8.1.1 Insert a row of data
8.1.2 Insert multiple rows of data
8.2 Update data in the table
8.2.1 update statement
8.2.2 Update all rows
8.2.3 Introducing a subquery in the where clause of update
8.2.4 Introducing subqueries in the set clause of update
8.3 Delete data in the table
8.3.1 delete statement
8.3.2 Delete all rows
8.3.3 Introducing a subquery in the where clause of delete
8.4 Loading and unloading of batch data
8.4.1 load statement
8.4.2 unload statement
8.5 Summary Chapter 9 Stored Procedures
9.1 Understanding stored procedures
9.1.1 What is a stored procedure?
9.1.2 How to deal with stored procedures
9.1.3 Why use stored procedures
9.2 How to create and use stored procedures
9.2.1 How to create a stored procedure
9.2.2 Finding errors in stored procedures
9.2.3 Execution of stored procedures
9.3 Using variables
9.3.1 Definition and use of variables
9.3.2 Scope of variables
9.3.3 Assigning values to variables
9.3.4 Expressions of SPL
9.4 SPL statement
9.4.1 Statement blocks
9.4.2 IF statement
9.4.3 FOR statement
9.4.4 WHILE statement
9.4.5 FOREACH statement
9.4.6 EXIT statement
9.4.7 CONTINUE statement
9.4.8 SYSTEM statement
9.5 Data transfer
9.5.1 Passing data to stored procedures
9.5.2 Returning data from stored procedures
9.6 Exception handling
9.6.1 Catching errors
9.6.2 Control domain of ON EXCEPTION statement
9.6.3 User-defined exceptions
9.7 Summary appendix page
Expand