Table of Contents
Preface v
1 SQL History and Implementations 1
The Relational Model and ANSI SQL 2
History of the SQL Standard 11
SQL Dialects 16
NoSQL 17
2 Foundational Concepts 19
Database Platforms Described in This Book 19
Categories of Syntax 20
SQL and Platform-Specific Data Types 35
Constraints 60
3 Structuring Your Data 69
How to Use This Chapter 69
SQL Platform Support 70
SQL Command Reference 72
4 Reading Your Data 249
How to Use This Chapter 249
SQL Platform Support 250
SQL Command Reference 251
5 Manipulating Your Data 359
How to Use This Chapter 359
SQL Platform Support 360
SQL Command Reference 361
6 Securing Your Data 439
How to Use This Chapter 439
SQL Platform Support 440
SQL Command Reference 441
7 SQL Built-in Functions 503
How to Use This Chapter 504
Types of Functions 504
SQL Functions 505
Platform-Specific Extensions 538
8 SQL Built-in Aggregate and Window Functions 593
How to Use This Chapter 593
SQL Aggregate Functions 594
Complementary Functions 623
SQL Window Functions 625
Platform-Specific Extensions 640
9 Storing Logic in the Database 647
How to Use This Chapter 647
SQL Platform Support 648
SQL Command Reference 650
10 Flexible and Schemaless 745
Why JSON? 747
JSON Support 749
Why XML? 777
Appendix. Shared and Platform-Specific Keywords 791
Index 799