SQL in a Nutshell applies the classic O'Reilly "Nutshell" format to Structured Query Language (SQL), the elegant descriptive language that's used to create and manipulate stores of data. This book explains the purpose and proper syntax of hundreds of SQL statements, as defined in four major SQL implementations, and details each entry with explanatory text and illustrative examples. Perhaps best of all, authors Kevin and Daniel Kline feature MySQL in their coverage, and give it billing that's equal to that of Oracle, Microsoft SQL Server, and PostgreSQL. Their inclusion of open-source MySQL, which in most situations carries no license fee, is recognition of its growing popularity and suitability for serious database applications; also, it improves this book's appeal to Unix and Linux developers.The majority of this slender book comprises eminently useful syntax documentation (which is in the style of Unix man pages, with bracketed options and monospace arguments) and the other information that's specific to individual statements and functions. Additionally, it includes a relatively small amount of conceptual information, such as a section on the proper use of NULL values. The material that's not statement-specific also contrasts data-type implementations of the four covered platforms - for example, readers learn that a PostgreSQL int2 value is known as a smallint in ANSI standard SQL. This is a particularly handy reference book, if you use one of the emphasized SQL implementations.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# SQL in a Nutshell: A Desktop Quick Reference
## 【One-Line Pitch】
A practical, vendor-comparative SQL reference that documents the syntax and behavior of hundreds of SQL statements across SQL Server, Oracle, MySQL, and PostgreSQL—ideal for developers who need a concise desktop guide or are migrating between database platforms.
## 【Book Arc】
- **Opening (~0%–9%)**: Introduces the book's purpose—covering SQL as implemented across four major databases (SQL Server, Oracle, MySQL, PostgreSQL)—and explains the RDBMS model, Codd's rules, and foundational relational database concepts.
- **Early (~9%–25%)**: Dives into foundational concepts: SQL99 standard datatypes, vendor-specific datatype mappings (e.g., PostgreSQL's int2 vs. ANSI smallint), and naming conventions for database objects.
- **Early (~25%–34%)**: Covers SQL syntax categories, keywords vs. reserved words, and a high-level overview of the SELECT statement, including projections, selections, and joins.
- **Middle (~34%–47%)**: The heart of the book—an alphabetical command reference. Each SQL statement includes a vendor support table (supported, supported with variations, supported with limitations, or not supported) followed by SQL99 syntax and vendor-specific implementations with examples.
- **Middle (~47%–end)**: Continues the command reference with detailed entries for statements like ALTER TABLE, CALL, and others, showing how each vendor implements the command differently.
## 【Key Takeaways】
- **Four-vendor comparison is the core value** (Opening): The book's unique selling point is its side-by-side treatment of SQL Server, Oracle, MySQL, and PostgreSQL—making it especially useful for developers working in multi-database environments or planning migrations.
- **Codd's rules define true relational databases** (Early): Twelve principles—including logical data representation in tables, uniform NULL handling, and metadata stored as regular data—provide benchmarks for designing proper relational databases.
- **Datatype mappings differ significantly across vendors** (Early): Understanding that a PostgreSQL int2 equals ANSI smallint, or that Oracle's NUMBER(p,s) has precision 1–38 and scale –84 to 127, is essential for cross-platform development.
- **Naming conventions improve maintainability** (Early): Use consistent, descriptive names with underscores; avoid company names, obvious prefixes like "DB_", and quoted identifiers—these practices make SQL self-documenting and easier to migrate.
- **Keywords and reserved words are not the same** (Early): Keywords have current SQL significance; reserved words may gain meaning in future releases. Both should be avoided as object names to future-proof your schema.
- **Read the SQL99 section first for each command** (Middle): The book's recommended approach is to read the introductory paragraph, vendor support table, and SQL99 syntax before vendor-specific details—common features are covered once under SQL99.
- **Vendor implementations vary in sophistication** (Middle): Oracle's ALTER TABLE, for example, offers extensive physical storage controls (extents, partitioning, caching), while MySQL's FOREIGN KEY and CHECK clauses are empty—accepted for portability but functionally inert.
## 【Reading Tips】
- **Use the vendor support tables as your entry point**: Before reading any command's details, check the table to see which dialects support it and how—this tells you whether to skim or deep-read.
- **Read SQL99 sections thoroughly, vendor sections selectively**: Common features are explained once under SQL99; vendor sections only add dialect-specific variations. Skip vendor sections for commands you don't use.
- **Treat this as a reference, not a tutorial**: Skim the conceptual chapters (RDBMS principles, datatypes, naming) once, then keep the book by your desk for the command reference.
- **Pay attention to the "not supported" entries**: Knowing that SQL Server lacks CALL (use EXECUTE instead) or that MySQL ignores FOREIGN KEY clauses can save hours of debugging.
- **Cross-reference CREATE TABLE when reading ALTER TABLE**: The book explicitly notes that subclauses for ALTER TABLE are documented under CREATE TABLE—don't expect full coverage in every entry.
## 【Coverage Limits】
This guide covers the book's structure, conceptual foundations, and reference approach based on excerpts through the middle of the command reference. The full alphabetical command list extends well beyond the sampled entries (ALTER PROCEDURE, ALTER TABLE, CALL), and the appendix on SQL99 and vendor-specific keywords is not covered here.
##
Page 5
Deloitte & Touche LLP. Kevin and his team perform data and infrastructure architecture in support of major knowledge management and transac- tion processing...
ints, authorization, transactions, and data manipulation. 6. Views must show the updates of their base tables and vice versa. 7. A single operation must be a...
onsistent and descriptive naming saves both time and energy. Giving a few minutes of thought to naming SQL objects in the begin- ning can prevent problems la...
LL, unless the table has no rows. The MODIFY keyword allows you to alter characteristics of a previously created table. The MODIFY CONSTRAINT allows you to d...
um number of archived redo logs so that the right amount of space is recorded in the control file. The MAXINSTANCES parameter sets the maximum number of inst...
be declared a return parameter by using the OUTPUT keyword. The value stored in the return parameter is passed back to any calling CREATE PROCEDURE 61 Book T...
stics of an Oracle table are defined using the next several blocks of code and their subblocks of code: -- physical_characteristics {[{[physical_attributes]...
es also perform conditional operations on the PL/SQL_block. When referencing values in the OLD and NEW pseudo-tables, the value must be prefaced with a colon...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
SQL in a Nutshell A Desktop Quick Reference (Kevin Kline)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
SQL in a Nutshell A Desktop Quick Reference (Kevin Kline)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment