Skip to main content

Joe Celko's SQL for Smarties

Advanced SQL Programming

Joe Celkos SQL for Smarties: Advanced SQL Programming offers tips and techniques in advanced programming. This book is the fourth edition and it consists of 39 chapters, starting… Read more

World Book Day celebration

Where learning shapes lives

Up to 25% off trusted resources that support research, study, and discovery.

Description

Joe Celkos SQL for Smarties: Advanced SQL Programming offers tips and techniques in advanced programming. This book is the fourth edition and it consists of 39 chapters, starting with a comparison between databases and file systems. It covers transactions and currency control, schema level objects, locating data and schema numbers, base tables, and auxiliary tables. Furthermore, procedural, semi-procedural, and declarative programming are explored in this book.

The book also presents the different normal forms in database normalization, including the first, second, third, fourth, fifth, elementary key, domain-key, and Boyce-Codd normal forms. It also offers practical hints for normalization and denormalization. The book discusses different data types, such as the numeric, temporal and character data types; the different predicates; and the simple and advanced SELECT statements. In addition, the book presents virtual tables, and it discusses data partitions in queries; grouping operations; simple aggregate functions; and descriptive statistics, matrices and graphs in SQL. The book concludes with a discussion about optimizing SQL. It will be of great value to SQL programmers.

Key features

  • Expert advice from a noted SQL authority and award-winning columnist who has given ten years service to the ANSI SQL standards committee
  • Teaches scores of advanced techniques that can be used with any product, in any SQL environment, whether it is an SQL 92 or SQL 2008 environment
  • Offers tips for working around deficiencies and gives insight into real-world challenges

Readership

This book is intended for working SQL programmers, database administrators, database designers, database analysts, and application system developers as well as those who are developing new features for database management systems who want to know about user needs. This would include anyone working with electronic content in the relational database context but also XML. Web services, etc.

Table of contents

About the AuthorIntroduction to the Fourth EditionChapter 1 Databases versus File Systems    1.1 Tables as Entities    1.2 Tables as Relationships    1.3 Rows versus Records    1.4 Columns versus Fields    1.5 Schema Objects    1.6 CREATE SCHEMA StatementChapter 2 Transactions and Concurrency Control    2.1 Sessions    2.2 Transactions and ACID    2.3 Concurrency Control    2.4 Pessimistic Concurrency Control    2.5 SNAPSHOT Isolation and Optimistic Concurrency    2.6 Logical Concurrency Control    2.7 Deadlock and LivelocksChapter 3 Schema Level Objects    3.1 CREATE SCHEMA Statement    3.2 CREATE PROCEDURE, CREATE FUNCTION, and CREATE TRIGGER    3.3 CREATE DOMAIN Statement    3.4 CREATE SEQUENCE    3.5 CREATE ASSERTION    3.6 Character Set Related ConstructsChapter 4 Locating Data and Special Numbers    4.1 Exposed Physical Locators    4.2 Generated Identifiers    4.3 Sequence Generator Functions    4.4 Preallocated Values    4.5 Special SeriesChapter 5 Base Tables and Related Elements    5.1 CREATE TABLE Statement    5.2 Nested UNIQUE Constraints    5.3 CREATE ASSERTION Constraints    5.4 TEMPORARY Tables    5.5 Manipulating Tables    5.6 Avoiding Attribute Splitting    5.7 Modeling Class Hierarchies in DDL    5.8 Exposed Physical Locators    5.9 Auto-Incrementing Columns    5.10 Generated Identifiers    5.11 A Remark on Duplicate Rows    5.12 Other Schema Objects    5.13 Temporary Tables    5.14 CREATE DOMAIN Statement    5.15 CREATE TRIGGER Statement    5.16 CREATE PROCEDURE Statement    5.17 DECLARE CURSOR StatementChapter 6 Procedural, Semiprocedural, and Declarative Programming    6.1 Basics of Software Engineering    6.2 Cohesion    6.3 Coupling    6.4 The Big Leap    6.5 Rewriting Tricks    6.6 Functions for Predicates    6.7 Procedural versus Logical DecompositionChapter 7 Procedural Constructs    7.1 CREATE PROCEDURE    7.2 CREATE TRIGGER    7.3 CURSORs    7.4 SEQUENCEs    7.5 Generated Columns    7.6 Table FunctionsChapter 8 Auxiliary Tables    8.1 The Series Table    8.2 Lookup Auxiliary Tables    8.3 Auxiliary Function Tables    8.4 Global Constants Tables    8.5 A Note on Converting Procedural Code to TablesChapter 9 Normalization    9.1 Functional and Multivalued Dependencies    9.2 First Normal Form (1NF)    9.3 Second Normal Form (2NF)    9.4 Third Normal Form (3NF)    9.5 Elementary Key Normal Form (EKNF)    9.6 Boyce-Codd Normal Form (BCNF)    9.7 Fourth Normal Form (4NF)    9.8 Fifth Normal Form (5NF)    9.9 Domain-Key Normal Form (DKNF)    9.10 Practical Hints for Normalization    9.11 Key Types    9.12 Practical Hints for DenormalizationChapter 10 Numeric Data Types    10.1 Numeric Types    10.2 Numeric Type Conversion    10.3 Four Function Arithmetic    10.4 Arithmetic and NULLs    10.5 Converting Values to and from NULL    10.6 Mathematical Functions    10.7 Unique Value Generators    10.8 IP AddressesChapter 11 Temporal Data Types    11.1 Notes on Calendar Standards    11.2 SQL Temporal Data Types    11.3 INTERVAL Data Types    11.4 Temporal Arithmetic    11.5 The Nature of Temporal Data ModelsChapter 12 Character Data Types    12.1 Problems with SQL Strings    12.2 Standard String Functions    12.3 Common Vendor Extensions    12.4 Cutter Tables    12.5 Nested ReplacementChapter 13 NULLs: Missing Data in SQL    13.1 Empty and Missing Tables    13.2 Missing Values in Columns    13.3 Context and Missing Values    13.4 Comparing NULLs    13.5 NULLs and Logic    13.6 Math and NULLs    13.7 Functions and NULLs    13.8 NULLs and Host Languages    13.9 Design Advice for NULLs    13.10 A Note on Multiple NULL ValuesChapter 14 Multiple Column Data Elements    14.1 Distance Functions    14.2 Storing an IPv4 Address in SQL    14.3 Storing an IPv6 Address in SQL    14.4 Currency and Other Unit Conversions    14.5 Social Security Numbers    14.6 Rational NumbersChapter 15 Table Operations    15.1 DELETE FROM Statement    15.2 INSERT INTO Statement    15.3 The UPDATE Statement    15.4 A Note on Flaws in a Common Vendor Extension    15.5 MERGE StatementChapter 16 Comparison or Theta Operators    16.1 Converting Data Types    16.2 Row Comparisons in SQL    16.3 IS [NOT] DISTINCT FROM OperatorChapter 17 Valued Predicates    17.1 IS NULL    17.2 IS [NOT]{TRUE

Review quotes

"If you work with SQL in any way, shape, or form, the most recent edition of Joe Celko’s SQL for Smarties needs to be on your bookshelf!"—Data Technology Today Blog

Product details

About the author

JC

Joe Celko

Joe Celko served 10 years on ANSI/ISO SQL Standards Committee and contributed to the SQL-89 and SQL-92 Standards.

Mr. Celko is author a series of books on SQL and RDBMS for Elsevier/MKP. He is an independent consultant based in Austin, Texas.

He has written over 1200 columns in the computer trade and academic press, mostly dealing with data and databases.

Affiliations and expertise
Independent Consultant, Austin, Texas

View book on ScienceDirect

Read Joe Celko's SQL for Smarties on ScienceDirect