The Art of SQL Queries cover

The Art of SQL Queries

Rating 3.8
Word count
267K words
Chapters
111
ISBN
9787115333407

Tags

Summary

SQL is a database query and programming language used to access data and to query, update, and manage relational database systems. It is a standard language in the database field, and any programmer who needs to work with databases must learn and master it. This book comprehensively introduces the fundamentals of databases and the techniques of SQL querying, helping readers master common SQL applications through abundant examples. Its 19 chapters follow the sequence of data definition, data querying, data manipulation, data control, transaction control, and programmatic SQL, explaining the basics of SQL programming in detail. Featuring more than 300 examples of varying sizes, the book highlights example-based teaching and the combination of learning with practice. It is intended for readers learning SQL programming, especially beginners, and also offers valuable reference for database architects and administrators.

Editor's review

SQL Query Art is a practical guide for database developers and data analysts. Co-authored by Zhang Quan and Guo Tianjiao and published by Posts & Telecom Press (ISBN 9787115333407), it holds a high rating on Douban, where reviewers generally describe it as systematic and rich in examples, suitable for learning from basics to advanced levels.

From an editor's professional perspective, the book's core value lies in its structured teaching and hands-on orientation. Rather than merely listing syntax, it guides readers through the logic of SQL via numerous query cases close to real business scenarios. It covers topics from simple SELECT statements to advanced ones such as complex multi-table joins, subqueries and window functions, with particular emphasis on query performance optimization and avoiding common mistakes—especially important for readers seeking to improve database operation efficiency.

Both authors have years of experience in database development and teaching, which makes the explanations rigorous yet accessible. The content follows a learning curve, with exercises in every chapter to consolidate knowledge. Compared with similar books, it focuses more on the "art"—how to write clear, efficient and maintainable SQL statements rather than merely achieving functionality. For readers who frequently interact with databases at work or are preparing for relevant technical interviews, this book offers solid skill improvement and mental training.

Who it's for

A good fit for

  • Students taking database courses who want to deepen their practical SQL skills
  • Development engineers who need to write complex queries or optimize database performance
  • People doing data analysis who need to extract and process data from databases
  • Job seekers preparing for technical interviews who want to systematically review and improve their SQL skills

Not a good fit for

  • Readers seeking in-depth management or architecture knowledge of specific database management systems (e.g., Oracle, SQL Server)
  • Absolute beginners looking for a quick syntax reference without understanding the underlying principles

Reading tips

  1. Read the chapters in order and be sure to complete the exercises in each chapter—practice is key to mastering SQL
  2. Focus on how query logic is constructed rather than memorizing syntax, and try to understand the execution order and impact of each clause
  3. Apply the optimization techniques to real work projects, and try refactoring existing queries to compare performance differences

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. 版权信息
  2. 文前
  3. 本书特点
  4. 本书内容
  5. 作者简介
  6. 本书主要读者对象
  7. 第1章
  8. 1..1 数据库的基本概念
  9. 1..2 数据库系统的结构、、组成及工作流程
  10. 1..3 关系数据库
  11. 1..4 SQL语言基础
  12. 1..5 SQL环境
  13. 第2章
  14. 2..1 SQL Server
  15. 2..2 Transact--SQL
  16. 第3章
  17. 3..1 表的基础知识
  18. 3..2 SQL数据类型
  19. 3..3 表的创建(CREATE)
  20. 3..4 表的修改
  21. 3..5 表的删除与重命名
  22. 3..6 创建、、删除数据库
  23. 第4章
  24. 4..1 索引的基础知识
  25. 4..2 索引的创建与销毁
  26. 4..3 视图的基础知识
  27. 4..4 视图的创建与销毁
  28. 第5章
  29. 5..1 查询的基本结构
  30. 5..2 列的查询
  31. 5..3 排序查询结果
  32. 5..4 使用WHERE子句定义搜索条件查询
  33. 第6章
  34. 6..1 本章用到的实例表
  35. 6..2 组合查询条件
  36. 6..3 IN运算符
  37. 6..4 NOT运算符
  38. 6..5 使用LIKE进行模糊查询
  39. 第7章
  40. 7..1 本章实例用到的表
  41. 7..2 连接符
  42. 7..3 数值运算
  43. 7..4 函数
  44. 第8章
  45. 8..1 聚合分析的基本概念
  46. 8..2 聚合函数的应用
  47. 8..3 组合查询
  48. 第9章
  49. 9..1 本章用到的实例表
  50. 9..2 表的基本连接
  51. 9..3 表的连接类型
  52. 9..4 UNION与UNION JOIN
  53. 9..5 表连接的其他应用及注意问题
  54. 第10章
  55. 10..1 创建和使用返回单值的子查询
  56. 10..2 创建和使用返回多行的子查询
  57. 10..3 相关子查询
  58. 10..4 嵌套子查询
  59. 10..5 使用子查询创建视图
  60. 10..6 树查询
  61. 第11章
  62. 11..1 插入单行记录
  63. 11..2 插入多行记录
  64. 11..3 表中数据的复制
  65. 11..4 从外部数据源导入、、导出数据
  66. 第12章
  67. 12..1 更新表中的数据
  68. 12..2 删除表中的数据
  69. 12..3 通过视图更新表
  70. 第13章
  71. 13..1 SQL安全模式
  72. 13..2 角色管理
  73. 13..3 权限管理
  74. 13..4 SQL Server安全管理
  75. 13..5 Oracle安全管理
  76. 第14章
  77. 14..1 完整性约束简介
  78. 14..2 与表有关的约束
  79. 14..3 深入探讨外键与完整性检查
  80. 14..4 域约束与断言
  81. 14..5 SQL Server中的完整性控制
  82. 第15章
  83. 15..1 SQL中的存储过程与函数
  84. 15..2 SQL Server 中的流控制语句
  85. 15..3 SQL Server中的存储过程和函数
  86. 15..4 Oracle中的流控制语句
  87. 15..5 Oracle数据库中的存储过程
  88. 第16章
  89. 16..1 触发器的基本概念
  90. 16..2 SQL Server中的触发器
  91. 16..3 Oracle数据库中触发器的操作
  92. 第17章
  93. 17..1 SQL游标的基本概念
  94. 17..2 SQL游标的使用
  95. 17..3 SQL Server中游标的扩展
  96. 17..4 Oracle中游标的使用
  97. 17..5 小结
  98. 第18章
  99. 18..1 SQL事务控制
  100. 18..2 事务控制的具体实现
  101. 18..3 并发控制
  102. 18..4 SQL Server中的并发事务控制
  103. 18..5 Oracle中的并发事务控制
  104. 第19章
  105. 19..1 SQL的调用
  106. 19..2 嵌入式SQL的使用
  107. 19..3 检索、、操作SQL数据
  108. 19..4 SQL Server中嵌入式SQL的编译运行
  109. 19..5 Oracle中嵌入式SQL的编译运行
  110. 附录A
  111. 附录B

FAQ

Is this book suitable for complete SQL beginners?
It starts from the basics but moves at a fast pace. Beginners are advised to first learn basic database concepts, then study this book systematically for better results.
Which database system are the example codes based on?
The examples mainly use standard SQL and are as compatible as possible with mainstream databases such as MySQL and PostgreSQL. Differences in some advanced features across databases are noted.
Is this book helpful for preparing for data analyst interviews?
Very helpful. It covers complex queries, aggregate analysis and window functions commonly used in data analysis—all high-frequency topics in relevant technical interviews.

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

张权 Author

Zhang Quan, about whom limited public information is available, can be understood as an author mainly through the signed works in the collection. Five of these works are included, covering a fairly wide range of subjects: computing, language and writing, education, business planning, and inspirational growth. Among them, The Art of SQL Queries addresses practical database query techniques; Research on Language Teaching: The Regularization Trend of English in a Networked Environment examines linguistic phenomena and English teaching in the online context; Research on Cultivating Core Chinese Language Competencies in Primary and Secondary Schools discusses Chinese language education; Business Planning Theory and Application concerns business practice; and Strategy: The Wisdom of the Ancient Chinese Officialdom turns to traditional strategic culture. Overall, Zhang Quan is a cross-disciplinary author whose works emphasize knowledge organization and practical application, and are suitable for readers with related study or work needs.

郭天娇 Author

Guo Tianjiao: publicly available information is limited, and the confirmable details about this author remain sparse. One work by this author is included in the collection, namely The Art of SQL Querying, which is categorized under general computer science. Judging from the title and category, the author focuses on the technical field of database query languages, taking the formulation, approach and techniques of SQL querying as the central subject. Books of this kind are usually aimed at readers who need to master data retrieval and processing, emphasizing an understanding of query logic starting from practical problems rather than a mere listing of syntax items. Because public information such as biography, educational background and professional experience is unavailable, no further description of the author's position or research direction can be given; the writing style and specific influence also await more material, and readers may form their own judgment based on the book's content.

More by the same author

Top rated in the same category