Effective SQL:编写高质量SQL语句的61条有效方法(英文版)
  • 推荐0
  • 收藏5
  • 浏览1.4K

Effective SQL:编写高质量SQL语句的61条有效方法(英文版)

John L. Viescas; Douglas J. Steele;Ben G. Clothier (作者)  无 (译者)

  • 丛  书:原味精品书系
  • 书  号:978-7-121-32284-6
  • 出版日期:2017-08-01
  • 页  数:348
  • 开  本:16(185*235)
  • 出版状态:上市销售
  • 原书名: Effective SQL: 61 Specific Ways to Write Better SQL
  • 原书号:9780134578897
  • 维护人:刘佳禾
本书全面系统地介绍了SQL语言各方面的基础知识以及一些高级特性,包括SQL数据语言、SQL方案语言、数据集操作、子查询以及内建函数与条件逻辑等内容。书中每个章节讲述一个相对独立的主题,并提供了相关示例和练习。涵盖了市场上常用数据库版本(MySQL 、Oracle 及Microsoft SQL Server等 )。同时针对开发基于数据库的应用程序,以及日常的数据库系统管理,本书都展现了大量经过实践检验的方法和技巧。读者可以通过对本书循序渐进地学习快速掌握SQL语言,也可以在实际工作中遇到问题时直接翻阅本书中的相关章节以获取解决方案。
1,Effective SQL这本书将切实有效的方法和实践解决方案整合在一起,使读者能够处理SQL语言中的复杂问题并且设计出能够简化数据管理操作的数据库。
2,本书也是当下市面上少有的能够将实践经验和实例代码结合的科学的数据库理论与实践的学习书籍。
3,本书也是少有的综合性的,全面的数据库书籍,涵盖当下主流的数据库如:IBM DB2,Microsoft Access,Mircosoft SQL Server,MySQL,Oracle Database,和PostgreSQL。

目录

Introduction 1
A Brief History of SQL 1
Database Systems We Considered 5
Sample Databases 6
Where to Find the Samples on GitHub 7
Summary of the Chapters 8
Chapter 1: Data Model Design 11
Item 1: Verify That All Tables Have a Primary Key 11
Item 2: Eliminate Redundant Storage of Data Items 15
Item 3: Get Rid of Repeating Groups 19
Item 4: Store Only One Property per Column 21
Item 5: Understand Why Storing Calculated Data Is Usually a Bad Idea 25
Item 6: Define Foreign Keys to Protect Referential Integrity 30
Item 7: Be Sure Your Table Relationships Make Sense 33
Item 8: When 3NF Is Not Enough, Normalize More 37
Item 9: Use Denormalization for Information Warehouses 43

Chapter 2: Programmability and Index Design 47
Item 10: Factor in Nulls When Creating Indexes 47
Item 11: Carefully Consider Creation of Indexes to Minimize Index and Data Scanning 52
Item 12: Use Indexes for More than Just Filtering 56
Item 13: Don’t Go Overboard with Triggers 61
Item 14: Consider Using a Filtered Index to Include or Exclude a Subset of Data 65
Item 15: Use Declarative Constraints Instead of Programming Checks 68
Item 16: Know Which SQL Dialect Your Product Uses and Write Accordingly 70
Item 17: Know When to Use Calculated Results in Indexes 74

Chapter 3: When You Can’t Change the Design 79
Item 18: Use Views to Simplify What Cannot Be Changed 79
Item 19: Use ETL to Turn Nonrelational Data into Information 85
Item 20: Create Summary Tables and Maintain Them 90
Item 21: Use UNION Statements to “Unpivot”Non-normalized Data 94

Chapter 4: Filtering and Finding Data 101
Item 22: Understand Relational Algebra and How It Is Implemented in SQL 101
Item 23: Find Non-matches or Missing Records 108
Item 24: Know When to Use CASE to Solve a Problem 110
Item 25: Know Techniques to Solve Multiple-Criteria Problems 115
Item 26: Divide Your Data If You Need a Perfect Match 120
Item 27: Know How to Correctly Filter a Range of Dates on a Column Containing Both Date and Time 124
Item 28: Write Sargable Queries to Ensure That the Engine Will Use Indexes 127
Item 29: Correctly Filter the “Right” Side of a “Left” Join 132

Chapter 5: Aggregation 135
Item 30: Understand How GROUP BY Works 135
Item 31: Keep the GROUP BY Clause Small 142
Item 32: Leverage GROUP BY/HAVING to Solve Complex Problems 145
Item 33: Find Maximum or Minimum Values Without Using GROUP BY 150
Item 34: Avoid Getting an Erroneous COUNT() When Using OUTER JOIN 156
Item 35: Include Zero-Value Rows When Testing for HAVING COUNT(x) < Some Number 159
Item 36: Use DISTINCT to Get Distinct Counts 163
Item 37: Know How to Use Window Functions 166
Item 38: Create Row Numbers and Rank a Row over Other Rows 169
Item 39: Create a Moving Aggregate 172

Chapter 6: Subqueries 179
Item 40: Know Where You Can Use Subqueries 179
Item 41: Know the Difference between Correlated and Non-correlated Subqueries 184
Item 42: If Possible, Use Common Table Expressions Instead of Subqueries 190
Item 43: Create More Efficient Queries Using Joins Rather than Subqueries 197

Chapter 7: Getting and Analyzing Metadata 201
Item 44: Learn to Use Your System’s Query Analyzer 201
Item 45: Learn to Get Metadata about Your Database 212
Item 46: Understand How the Execution Plan Works 217

Chapter 8: Cartesian Products 227
Item 47: Produce Combinations of Rows between Two Tables and Flag Rows in the Second That Indirectly Relate to the First 227
Item 48: Understand How to Rank Rows by Equal Quantiles 231
Item 49: Know How to Pair Rows in a Table with All Other Rows 235
Item 50: Understand How to List Categories and the Count of First, Second, or Third Preferences 240

Chapter 9: Tally Tables 247
Item 51: Use a Tally Table to Generate Null Rows Based on a Parameter 247
Item 52: Use a Tally Table and Window Functions for Sequencing 252
Item 53: Generate Multiple Rows Based on Range Values in a Tally Table 257
Item 54: Convert a Value in One Table Based on a Range of Values in a Tally Table 261
Item 55: Use a Date Table to Simplify Date Calculation 268
Item 56: Create an Appointment Calendar Table with All Dates Enumerated in a Range 275
Item 57: Pivot Data Using a Tally Table 278

Chapter 10: Modeling Hierarchical Data 285
Item 58: Use an Adjacency List Model as the Starting Point 286
Item 59: Use Nested Sets for Fast Querying Performance with Infrequent Updates 288
Item 60: Use a Materialized Path for Simple Setup and Limited Searching 291
Item 61: Use Ancestry Traversal Closure for Complex Searching 294

Appendix: Date and Time Types, Operations, and Functions 299
IBM DB2 299
Microsoft Access 303
Microsoft SQL Server 305
MySQL 308
Oracle 313
PostgreSQL 315
Index 317

读者评论

下载资源

图书类别

同系列书

  • Clean Architecture:软件架构与设计匠艺(英文版)

    Robert C. Martin (作者) Robert C. Martin(罗伯特·C·马丁) (译者)

    马丁的简介代码不仅仅是提供选项。在半个世纪的软件环境中,每一种可以想象的类型,马丁告诉你做出什么选择,以及为什么它们对你的成功至关重要。正如你所渴望的,这本书中...

     
  • Effective Java(第2版)英文版

    (美)Joshua Bloch(约书亚·布洛赫) (作者) 无 (译者)

    本书通过78个有效案例,旨在帮助读者深入理解Java,以写出更加清楚、健壮、可重复使用的代码。书中每个章节均包含小论文,针对Java平台和杰出的代码样例,提供了...

    ¥65.00
  • C11编程导论英文版

    (美)Paul Deitel(保罗·戴特尔),(美) Harvey Deitel(哈维·戴特尔) (作者) (译者)

    本书沿用了Deitel特色的“程序实况解说”,深入探讨了C语言和C标准库。通过完整的语法着色、代码高亮、代码演练和程序输出,全面地介绍了测试程序的概念。本书汇集...

    ¥89.00
  • Effective Javascript:编写高质量JavaScript代码的68个有效方法 英文版

    (美)David Herman(大卫·赫尔曼) (作者) 无 (译者)

    本书由资深 JavaScript 技术专家 David Herman 所著。书中基于 JavaScript 标准的新版本前所未有地阐明了 JavaScript ...

    ¥65.00
  • Effective Python:编写高质量Python代码的59个有效方法 英文版

    (美)Brett Slatkin(布雷特·斯拉特金) (作者) 无 (译者)

    本书不是要讲述 Python 的基础编程,而是要帮你掌握 Python 独特的优势和魅力。书中总结了 59个 Python 编程的优秀实践、贴士和捷径,并用真实...

    ¥65.00

相关图书

SequoiaDB分布式数据库权威指南

黄达玮 (作者)

本书旨在介绍 SequoiaDB 巨杉数据库的基本概念、应用场景、企业级应用案例、数据库实例创建与管理方式、数据库集群管理的基本策略、以及性能调优和问题诊断。...

¥99.00

千金良方——MySQL性能优化金字塔法则

李春 罗小波 董红禹 (作者)

本书一共分为3篇:基础篇、案例篇和工具篇。“基础篇”从理论基础和基本原理层面介绍了MySQL的安装与配置、升级和体系结构,information_schema、...

¥90.30

数据分析与量化投资——基于SAS的应用

林煜恩 (作者)

本书基于SAS EG平台下,采用项目管理的过程流方式来介绍数据分析以及量化投资策略方法,书中提供了作者撰写的autoexec命令文件,可让SAS在运行时,就自带...

 

DBA 手记——Oracle 数据安全的警示与原则

盖国强 (作者)

本书以数据安全为主线将众多灾难挽救过程串联在一起,不仅对各个案例的发生过程进行了详细描述,更为读者提供了具体的规避法则。其间穿插介绍了很多新鲜的技术细节和恢复方...

¥99.00

收获,不止Oracle(第2版)

梁敬彬 (作者)

在这本书里,读者将会跟随作者一同对Oracle数据库的相关知识进行梳理,最终共同提炼出必须最先掌握的那部分知识,无论你是数据库开发、管理、优化、设计人员,还是从...

¥99.00

MySQL王者晋级之路

张甦 (作者)

目前大部分软件开发平台都基于Linux,很多互联网公司都把MySQL作为后端数据存储的数据库。如果把MySQL比喻成数据库界的一条巨龙,则本书涵盖的所有知识点就...

¥79.00