Book description
Combining theory with everyday practicality, this definitive volume is packed with the up-to-date information, new features, and explanations you need to get the very most out of SQL and its latest standard. The book is unique in that every chapter highlights how the new SQL standard applies to the three major databases, Oracle 11g, IBM DB2 9.5, and Microsoft SQL Server 2008. The result is a comprehensive, useful, and real-world reference for all SQL users, from beginners to experienced developers.
Table of contents
- Copyright
- About the Authors
- Credits
- Acknowledgments
-
Introduction
- Whom This Book Is For
-
How This Book Is Organized
- Part I: SQL Basic Concepts and Principles
- Part II: Creating and Modifying Database Objects
- Part III: Data Manipulation and Transaction Control
- Part IV: Retrieving and Transferring Data
- Part V: Implementing Security Using the System Catalog
- Part VI: Beyond SQL: Procedural Programming and Database Access Mechanisms
- Appendixes
- Conventions Used in This Book
-
I. SQL Basic Concepts and Principles
- 1. SQL and Relational Database Management Systems
- 2. Fundamental SQL Concepts and Principles
-
3. SQL Data Types
- 3.1. No Strings Attached
- 3.2. In Numbers Strength
- 3.3. Once Upon a Time: Date and Time Data Types
- 3.4. XML Data Type
- 3.5. Constructed and User-Defined Data Types
- 3.6. Other Data Types
- 3.7. NULL
- 3.8. Summary
-
II. Creating and Modifying Database Objects
-
4. Creating RDBMS Objects
-
4.1. Tables
-
4.1.1. CREATE TABLE Statement
- 4.1.1.1. SQL:2003 syntax
- 4.1.1.2. Oracle 11 g syntax
- 4.1.1.3. DB2 9.5 syntax
- 4.1.1.4. Microsoft SQL 2008 syntax
- 4.1.1.5. Permanent and temporary tables
- 4.1.1.6. Column definitions
- 4.1.1.7. Column constraints
- 4.1.1.8. Column default values
- 4.1.1.9. Column collating sequence
- 4.1.1.10. Table constraints
- 4.1.1.11. ON COMMIT clause
- 4.1.1.12. Physical properties clause
- 4.1.1.13. Identity clause
- 4.1.1.14. Creating a new table as a copy of another table
-
4.1.1. CREATE TABLE Statement
- 4.2. Indexes
- 4.3. Views
- 4.4. Aliases and Synonyms
- 4.5. Schemas
- 4.6. Sequences
- 4.7. Other SQL:2003 and Implementation-Specific Objects
- 4.8. CREATE Statement Cross-Reference
- 4.9. Summary
-
4.1. Tables
-
5. Altering and Destroying RDBMS Objects
-
5.1. Tables
-
5.1.1. ALTER TABLE statement
- 5.1.1.1. SQL:2003
-
5.1.1.2. Oracle 11 g
- 5.1.1.2.1. Changing physical attributes
- 5.1.1.2.2. Adding columns
- 5.1.1.2.3. Modifying existing columns
- 5.1.1.2.4. Removing table columns
- 5.1.1.2.5. Modifying constraints
- 5.1.1.2.6. Creating new constraints
- 5.1.1.2.7. Removing constraints
- 5.1.1.2.8. Disabling and enabling constraints
- 5.1.1.2.9. Renaming a table
- 5.1.1.3. DB2 9.5
- 5.1.1.4. Microsoft SQL Server 2008
- 5.1.2. DROP TABLE statement
-
5.1.1. ALTER TABLE statement
- 5.2. Indexes
- 5.3. Views
- 5.4. Aliases and Synonyms
- 5.5. Schemas
- 5.6. Sequences
- 5.7. Other Implementation-Specific Objects
- 5.8. ALTER and DROP Statements Cross-Reference
- 5.9. Summary
-
5.1. Tables
-
4. Creating RDBMS Objects
-
III. Data Manipulation and Transaction Control
-
6. Data Manipulation Language (DML)
- 6.1. INSERT: Populating Tables with Data
-
6.2. UPDATE: Modifying Table Data
- 6.2.1. Common UPDATE statement clauses
- 6.2.2. Vendor-specific UPDATE statement details
- 6.3. DELETE: Removing Data from Tables
- 6.4. MERGE: Combining INSERT, UPDATE, and DELETE in One Statement
- 6.5. TRUNCATE Statement
- 6.6. Summary
- 7. Sessions, Transactions, and Locks
-
6. Data Manipulation Language (DML)
-
IV. Retrieving and Transferring Data
-
8. Understanding the SELECT Statement
- 8.1. Single Table SELECT Statement Syntax
- 8.2. SELECT Clause: What Do You Select?
- 8.3. FROM Clause: Select from What?
- 8.4. WHERE Clause: Setting Horizontal Limits
- 8.5. GROUP BY and HAVING Clauses: Summarizing Results
- 8.6. ORDER BY Clause: Sorting Query Output
- 8.7. Combining the Results of Multiple Queries
- 8.8. SQL Analytic Functions and Top N Queries
- 8.9. Summary
-
9. Multitable Queries
- 9.1. Inner Joins
- 9.2. Outer Joins: Joining Tables on Columns Containing NULL Values
- 9.3. Joins Involving Inline Views
- 9.4. Multitable Joins with Correlated Queries
- 9.5. Improving Efficiency of Multitable Queries
- 9.6. Summary
- 10. SQL Functions
- 11. SQL Operators
-
8. Understanding the SELECT Statement
-
V. Implementing Security Using the System Catalog
-
12. SQL and RDBMS Security
- 12.1. Basic security mechanisms
- 12.2. Defining a Database User
- 12.3. Managing Security with Privileges
- 12.4. Managing Security with Roles
- 12.5. Using Views for Security
- 12.6. Using Constraints for Security
- 12.7. Using Stored Procedures and Triggers for Security
- 12.8. Database Auditing
- 12.9. Security Standards
- 12.10. Summary
-
13. The System Catalog and INFORMATION_SCHEMA
- 13.1. SQL System Catalogs
- 13.2. Oracle 11 g Data Dictionary
- 13.3. IBM DB2 9.5 System Catalogs
- 13.4. Microsoft SQL Server 2008 System Catalog
- 13.5. Summary
-
12. SQL and RDBMS Security
-
VI. Beyond SQL: Procedural Programming and Database Access Mechanisms
-
14. Stored Procedures, Triggers, and User-Defined Functions
- 14.1. Procedural Extension Uses and Benefits
- 14.2. Key Elements of a SQL Procedural Language
- 14.3. Oracle 11 g
- 14.4. DB2 9.5
- 14.5. Microsoft SQL Server 2008
- 14.6. Stored Procedures
- 14.7. User-Defined Functions
- 14.8. Triggers
- 14.9. .NET Stored Procedures and Functions
- 14.10. Summary
- 15. SQL and XML
-
16. SQL and Procedural Programming
- 16.1. SQL Statement Processing Steps
- 16.2. Embedded and Dynamic SQL
- 16.3. SQL/CLI Standard
- 16.4. Open Database Connectivity and Object Linking and Embedding, Database
- 16.5. SQL and Java
- 16.6. Oracle API options
- 16.7. IBM DB2 Call-Level Interface
- 16.8. Microsoft Data Access Interfaces
- 16.9. Summary
-
17. The Future of SQL
- 17.1. OLAP and Business Intelligence
- 17.2. LINQ to SQL
- 17.3. Objects
- 17.4. Summary
- A. Accompanying Website
- B. The ACME Sample Database
- C. Basics of Relational Database Design
- D. Installing RDBMS Software
- E. Accessing RDBMS
- F. Installing the ACME Database
- G. SQL Functions
- H. SQL Syntax Reference
- I. SQL-Reserved Keywords
- J. The Other RDBMSs
- K. A Brief Introduction to Number Systems, Boolean Algebra, and Set Theory
-
14. Stored Procedures, Triggers, and User-Defined Functions
Product information
- Title: SQL Bible, Second Edition
- Author(s):
- Release date: April 2008
- Publisher(s): Wiley
- ISBN: 9780470229064
You might also like
book
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 3rd Edition
Through a recent series of breakthroughs, deep learning has boosted the entire field of machine learning. …
book
A Guide to the Project Management Body of Knowledge (PMBOK® Guide) – Seventh Edition and The Standard for Project Management (ENGLISH)
PMBOK® Guide is the go-to resource for project management practitioners. The project management profession has significantly …
book
Learning SQL, 3rd Edition
As data floods into your company, you need to put it to work right away—and SQL …
book
Head First SQL
Is your data dragging you down? Are your tables all tangled up? Well we've got the …