6本最好的免费SQL书籍

jopen 11年前

结构化查询语言(SQL)是一个专门的编程语言,最初是由IBM在20世纪70年代初开发。用于访问和操作在关系数据库管理系统(RDBMS)中的数据。

几乎所有的数据库管理系统有一个SQL实现。它是最流行的查询语言,因为它为数据库管理员提供了很好的功能,功耗,易用性。SQL标准由美国国家标准学会(ANSI)于1986年,经历了多次修改。语言包括数据定义语言和数据操纵语言。该语言被划分成若干要素:条款,表达式,谓词,查询和报表。


1. Practical PostgreSQL

Website www.commandprompt.com/ppbook/
Author Joshua D. Drake, John C. Worsley
Format HTML
Pages 640

Practical PostgreSQL is a comprehensive book that shows the reader how to compile PostgreSQL from source, create a database, and configure PostgreSQL to accept client-server connections. It also covers the many advanced features, such as transactions, versioning, replication, and referential integrity that enable developers and DBAs to use PostgreSQL for serious business applications.

The thorough introduction to PostgreSQL's PL/pgSQL programming language explains how you can use this very useful but under-documented feature to develop stored procedures and triggers. The book includes a complete command reference, and database administrators will benefit from the chapters on user management, database maintenance, and backup & recovery. With Practical PostgreSQL, the reader will discover quickly why this open source database is a great open source alternative to proprietary products from Oracle, IBM, and Microsoft.

Chapters cover:

  • Introduction and Installation
  • Using PostgreSQL - cover understanding SQL, using SQL with PostgreSQL, operators and functions, PostgreSQL clients (psql and PgAccess), and advanced features
  • Administrating PostgreSQL - authentication and encryption, database management, user and group management
  • Programming with PostgreSQL - PL/pgSQL, JDBC, and LXP
  • PostgreSQL Command Reference
  • Appendixes: Multibyte Encoding Types, Backend Options for Postgres, Binary COPY Format, and Internal pyql Variables
</td> </tr> </tbody> </table>

2. SQL Performance Explained

Website use-the-index-luke.com/sql/table-of-contents
Author Markus Winand
Format HTML
Pages 204

SQL Performance Explained helps developers to improve database performance. The focus is on SQL; it covers all major SQL databases without getting lost in the details of any one specific product.

Starting with the basics of indexing and the WHERE clause, SQL Performance Explained guides developers through all parts of an SQL statement and explains the pitfalls of object-relational mapping (ORM) tools like Hibernate.

Topics covered include:

  • Anatomy of an Index - the fundamental structure of an index
  • The Where Clause - explains all aspects of the where clause, from very simple single column lookups to complex clauses for ranges and special cases such as LIKE
  • Performance and Scalability - looks at Performance and Scalability
  • The Join Operation - an explanation of how to use indexes to perform a fast table join
  • Clustering Data - the difference between selecting a single column and all columns
  • Sorting and Grouping - even order by and group by can use indexes
  • Partial Results - explains how to benefit from a "pipelined" execution if you don’t need the full result set
  • Insert, Delete and Update
  • Appendices: Execution Plans, Myth Directory, and Example Schema
</td> </tr> </tbody> </table>

3. A Primer on SQL

Website www.dreamincode.net/.../entry-4251-my-free-ebook-a-primer-on-sql
Author Rahul Batra
Format PDF
Pages 42

A Primer on SQL is a fairly short ebook teaching the basics of SQL. The author assumes that the reader has no previous experience of SQL.

While the examples and text use Ingres as the database management system, the code should work correctly on any SQL compliant database. Since this text deals largely with teaching SQL in a product independent manner, rather than the teaching of Ingres per se, details with respect to installation and specific operations of the product is kept to a minimum.

Chapters cover:

  • An Introduction to SQL
  • Getting your Database ready - covers the basic of creating a database, inserting data, and writing a query
  • Constraints - a rule that you apply or abide by while doing SQL operations. This chapter examines selective fields INSERT, primary key constraint, unique key constraint, and the differences between a primary key and a unique key
  • Operations on Tables - drop tables, create new tables from existing tables, modify tables, verifying the result in Ingres and other database systems
  • Writing Basic Queries - a query is a SQL statement that is used to extract a subset of data from your database and presents it in a readable format
  • Manipulating Data - looks at the Data Manipulation Language (DML) part of SQL which is used to make changes to the data inside a relational database
  • Organizing your Data - covers normalization, atomicity, repeating groups, and splitting the table
  • Doing more with Queries - more examples of how we can modify SELECT statements; counting the records in a table, column aliases, and using the LIKE operator
  • Aggregation and Grouping - an aggregate function is used to compute summarization information from a table or tables. Looks at using DISTINCT with COUNT, using MIN to find minimum values, grouping data with the GROUP BY clause of a SELECT query, and the HAVING clause
  • Understanding Joins - a join operation allows you to retrieve data from multiple tables in a single SELECT query

This material is licensed under the Open Publication License, v1.0 or later.

</td> </tr> </tbody> </table>

4. Sams Teach Yourself SQL in 24 Hours

Website www.informit.com/library/library.aspx?b=STY_Sql_24
Author Ron Plew, Ryan Stephens
Format HTML
Pages 670

Sams Teach Yourself SQL in 24 Hours presents the key features of SQL (Structured Query Language) in an easy to understand format with updated code examples, notes, diagrams, exercises, and quizzes. This book was written primarily for those with very little or no experience with relational database management systems using SQL.

This book is not a complete SQL reference and should not be relied on as a sole reference of SQL. However, this book combined with a complete SQL command reference could serve as a complete solution.

Chapters cover:

  • SQL Concepts Overview
  • Building Your Database
  • Getting Effective Results from Queries
  • Building Sophisticated Database Queries
  • SQL Performance Tuning
  • Using SQL to Manage Users and Security
  • Summarized Data Structures
  • Applying SQL Fundamentals in Today's World
</td> </tr> </tbody> </table>

5. SQL for Web Nerds

Website philip.greenspun.com/sql/
Author Philip Greenspun
Format HTML
Pages 300

SQL for Web Nerds is a structured online book on SQL, based on the Oracle database. Queries, transactions, triggers, and RDBMS concepts are covered. Tap into the power of the relational database management system for concurrency control and transaction management.

  • Data modeling - tell the relational database management system what elements of the data you will store, how large each element can be, what kind of information each element can contain, what elements may be left blank, which elements are constrained to a fixed range, and whether and how various tables are to be linked
  • Simple queries: one table, one table with subquery, JOIN, JOIN with subquery, OUTER JOIN
  • More complex queries: GROUP BY, aggregates, HAVING
  • Transactions (inserts and updates) examining atomicity, consistency, and mutual exclusion
  • Triggers - fragments of code that you tell Oracle to run before or after a table is modified
  • Views - a way of building even greater abstraction
  • Style
  • Escaping to the procedural world: PL/SQL and Java executing inside the Oracle server
  • Trees in Oracle SQL - shows the reader that a row in an SQL database can be thought of as an object, a pointer from one object to another can be represented by storing an integer key in a regular database column, demonstrates the Oracle tree extensions (CONNECT BY ... PRIOR), and how to work around the limitations of CONNECT BY with PL/SQL
  • Handling dates in Oracle
  • Limits in Oracle; how they will bite you and how to work around them
  • Tuning - what to do when your query runs too slowly
  • Data warehousing - what to do when your query doesn't answer your questions
  • Foreign and legacy data, making foreign Web sites look like local SQL tables
  • Normalization - a way of splitting up data until each table represents propositions about a single type of thing
</td> </tr> </tbody> </table>

6. Developing Time-Oriented Database Applications in SQL

Website www.cs.arizona.edu/people/rts/
Author Richard T. Snodgrass
Format PDF
Pages 528

Developing Time-Oriented Database Applications in SQL is an out-of-print book which showsprofessional SQL programmers how to effectively develop applications that involve time-oriented data and queries. It explains in detail how to record temporal data in tables using the SQL types, how to define appropriate integrity restraints, how to correctly update temporal tables using interactive and embedded SQL, and how to write a wide range of interactive and embedded SQL queries involving temporal tables

Sample queries include time-slice queries, different kinds of temporal joins, temporal coalescing, temporal aggregates, temporal unions, differences, and intersections.

This book assumes that the reader is comfortable with the SQL query language.

Chapters cover:

  • Fundamental concepts - valid-time state tables, transaction-time state tables, and bitemporal tables
  • Instants and intervals - also looks at predicates, constructors, implementation considerations and more
  • Periods - literals, predicates, constructors, and implementation considerations
  • Defining state tables - initial schema, adding history, temporal keys, handling now, uniqueness, referential integrity, and constraint attributes
  • Querying state tables - extracting the current state, extracting prior states, sequenced queries, nonsequenced variants, and eliminating duplicates
  • Modifying State Tables - current / sequenced / nonsequenced modifications, modifications that mention other tables, and temporal partitioning
  • Retaining a Tracking Log - defining the tracking log, queries, modifications, permitting insertions, backlogs, using after-images consistently, and transaction semantics
  • Transaction-Time State Tables - definition, maintenance, queries, temporal partitoning, and vacuuming
  • Bitemporal Tables - definition, modifications, queries, integrity partioning, and vaccuming
  • Temporal Database Design - properly sequencing the design, conceptual / logical / physical design, advanced design aspects, benefits, and application development
  • Language Directions - SQL-92, SQL-92 limitations, SQL3, periods, defining valid-time state tables, querying and modifying state tables, retaining a tracking log, transaction-time state tables, bitemporal tables, capstone case, migration, and additional constructs of SQL3
</td> </tr> </tbody> </table>