商品描述
Learn SQL basics quickly with this visual tutorial featuring over 125 graphics SQL (Structured Query Language) is the tool used to access nearly all databases, which means that most software professionals should understand at least the basics. This hands-on tutorial offers an accessible introduction to SQL using over 125 graphics to illustrate the lessons. The book's unique visual approach makes it much easier for the reader to learn SQL. This Second Edition has been updated with new graphics and covers such subjects as the SELECT statement, joins, subqueries, views, granting and revoking privileges, and creating and destroying tables.
Table of Contents
Foreword.
Preface.
Chapter 1: Introducing SQL.
Kinds of Database Systems.
Relational Concepts.
Tables, Rows, and Columns.
Keys.
An Example Table.
The Visual Approach.
Chapter 2: Elements of the Language.
Ways to Use SQL.
Versions of SQL.
Defining the Language.
Data Types.
The Structure of SQL Statements.
Keywords.
An Example Database.
Organization of the Examples.
Chapter 3: Retrieving Data from a Table: The SELECT Statement.
Selecting Specific Columns in a Table.
Selecting All Columns in a Table.
Selecting Only Some of a Table's Records: The WHERE Clause.
Comparisons in a WHERE Clause.
Combining Predicates in a WHERE Clause.
Using AND.
Using OR.
Using NOT.
Other Uses of WHERE.
BETWEEN and NOT BETWEEN.
LIKE and NOT LIKE.
IN and NOT IN.
IS NULL and IS NOT NULL.
Chapter 4: More on SELECT.
Ordering Selected Data.
Doing Arithmetic with Selected Information.
Using Aggregates.
Finding Maximum and Minimum Values.
Totaling Columns.
Finding Averages.
Counting Records.
Using DISTINCT.
Grouping Selected Data.
More on Grouping: The HAVING Clause.
Chapter 5: Retrieving Data from Several Tables: Joins.
Qualified Names.
What Is a Join?
Restricting the Results of a Join.
Query Diagrams for Joins.
Joining Tables Using the Join Operator.
Manipulating the Results of a Join.
Aliases.
Joins with Three Tables.
The Visual Approach with More Than Two Tables.
Joins with More Than Three Tables.
Retrieving the Same Information in Different Ways.
Using GROUP BY in a Join.
Chapter 6: Queries within Queries: Subqueries.
What Is a Subquery?
Using Comparison Operators with Subqueries.
Using ANY and ALL.
Existence Tests.
Correlated Subqueries.
Using HAVING with Correlated Subqueries.
Chapter 7: Creating and Destroying Tables.
Creating a Table.
Disallowing NULL Values.
Requiring Unique Values in a Column.
Destroying (Dropping) Tables.
Chapter 8: Adding, Modifying, and Deleting Records.
Adding Records to a Table.
Adding Records with Values Only for Some Columns.
Adding Records Using SELECT.
Modifying Records in a Table.
Deleting Records from a Table.
Chapter 9: Views.
Creating Views.
Creating Views Based on One Table.
Creating Views Based on More Than One Table.
Queries Using Views.
Selecting Records from a View.
Adding Records to a View.
Modifying Records in a View.
Deleting Records from a View.
Destroying (Dropping) Views.
Chapter 10: Granting and Revoking Privileges.
Granting Privileges.
Granting Privileges on Views.
Passing Privileges On: The GRANT Option.
Revoking Privileges.
Chapter 11: Advanced Topics.
Indexes.
Creating Indexes.
When to Create Indexes.
Destroying Indexes.
Using Multiple SQL Statements to Solve a Problem.
Outer Joins.
Unions.
Joining a Table with Itself.
Final Thoughts.
Appendix A: The Example Database.
Appendix B: List of Examples.
Appendix C: The Example Database.
Index.
商品描述(中文翻譯)
快速學習 SQL 基礎知識,這本視覺化教程包含超過 125 張圖形。SQL(結構化查詢語言)是用來訪問幾乎所有數據庫的工具,這意味著大多數軟體專業人員應該至少了解基本概念。這本實作教程提供了一個易於理解的 SQL 介紹,使用超過 125 張圖形來說明課程內容。這本書獨特的視覺化方法使讀者更容易學習 SQL。本第二版已更新新圖形,涵蓋了如 SELECT 語句、聯接、子查詢、視圖、授予和撤銷權限,以及創建和刪除表等主題。
目錄
前言
序言
第一章:介紹 SQL
數據庫系統的種類
關聯概念
表、行和列
鍵
示例表
視覺化方法
第二章:語言的元素
使用 SQL 的方式
SQL 的版本
定義語言
數據類型
SQL 語句的結構
關鍵字
示例數據庫
示例的組織
第三章:從表中檢索數據:SELECT 語句
選擇表中的特定列
選擇表中的所有列
僅選擇表中某些記錄:WHERE 子句
WHERE 子句中的比較
在 WHERE 子句中組合謂詞
使用 AND
使用 OR
使用 NOT
WHERE 的其他用法
BETWEEN 和 NOT BETWEEN
LIKE 和 NOT LIKE
IN 和 NOT IN
IS NULL 和 IS NOT NULL
第四章:更多關於 SELECT
對選定數據進行排序
對選定信息進行算術運算
使用聚合函數
查找最大值和最小值
對列進行總計
查找平均值
計算記錄數
使用 DISTINCT
對選定數據進行分組
更多關於分組:HAVING 子句
第五章:從多個表中檢索數據:聯接
合格名稱
什麼是聯接?
限制聯接的結果
聯接的查詢圖
使用聯接運算符聯接表
操作聯接的結果
別名
三個表的聯接
超過兩個表的視覺化方法
超過三個表的聯接
以不同方式檢索相同信息
在聯接中使用 GROUP BY
第六章:查詢中的查詢:子查詢
什麼是子查詢?
在子查詢中使用比較運算符
使用 ANY 和 ALL
存在性測試
相關子查詢
在相關子查詢中使用 HAVING
第七章:創建和刪除表
創建表
不允許 NULL 值
要求列中的唯一值
刪除(丟棄)表
第八章:添加、修改和刪除記錄
向表中添加記錄
僅為某些列添加值的記錄
使用 SELECT 添加記錄
修改表中的記錄
從表中刪除記錄
第九章:視圖
創建視圖
基於一個表創建視圖
基於多個表創建視圖
使用視圖的查詢
從視圖中選擇記錄
向視圖中添加記錄
修改視圖中的記錄
從視圖中刪除記錄
刪除(丟棄)視圖
第十章:授予和撤銷權限
授予權限
對視圖授予權限
傳遞權限:GRANT 選項
撤銷權限
第十一章:進階主題
索引
創建索引
何時創建索引
刪除索引
使用多個 SQL 語句解決問題
外部聯接
聯合
將表與自身聯接
最後的思考
附錄 A:示例數據庫
附錄 B:示例列表
附錄 C:示例數據庫
索引