Applied SQL - Preparation of Manipulation Statements - SQL Server 2022: Part 1 of 3 How to Write SELECT in SQL Server
暫譯: 應用 SQL - 操作語句的準備 - SQL Server 2022:第 1 部分 如何在 SQL Server 中撰寫 SELECT

Carsten Saastamoinen-Jakobsen

  • 出版商: Independent Publisher
  • 出版日期: 2025-03-24
  • 售價: $2,400
  • 貴賓價: 9.5$2,280
  • 語言: 英文
  • 頁數: 425
  • 裝訂: Paperback
  • ISBN: 9798314439791
  • ISBN-13: 9798314439791
  • 相關分類: MSSQLSQL
  • 無法訂購

買這商品的人也買了...

相關主題

商品描述

Part 1 of the book has focus on writing a SELECT statement. When preparing manipulation statements, it should be planned how the statement should be structured before the statement is written. First we need to know exactly how the tables are created. We need to know all the constraints specified for the individual tables and columns in terms of data type, NULL/NOT NULL, Primary Key, Foreign Keys, Check Constraints and Triggers.

Relational databases are based on mathematics. Therefore, mathematics can be used to advantage when planning a statement.

Part 1 of the book is about writing correct and best performing SELECT statements.

The book contains the following topics.

  • Understanding the definition of a database, tables and constraints.
  • Brief, general overview of the mathematics that must be used when preparing a statement.
  • The 8 Algebra Operation – how to use this for writing correct well performing and correct statements.
    • Selection
    • Projection
    • Join – detailed review of the different join types
    • UNION, INTERSECT and EXCEPT
    • Cartesian Product
    • Divide
  • Examples of using the Algebra Operations but not least with a focus on Joining many tables, so that we get a correct and maintainable result.
  • Grouping of data - GROUP BY, CUBE, ROLLUP, GROUP BY GROUPING SETS and Window Functions.
  • Sub-Select.

Part 2 is about the Different Object types and about Index in SQL Server.

There are many different object types in SQL Server. These are reviewed in Part 2 of the book. In addition, there is a review of the Index types with focus on understanding how the index is structured and can be used.

The topics are Views, PIVOT, UNPIVOT, APPLY JOIN, CTE, INSERT, DELETE, UPDATE, MERGE and TRUNCATE.

Definition of Stored Procedure, Function and Trigger. Temporal Data and InMemory Optimized Tables are important possibilities to know about. Maybe Data Masking and Row Level Security are not used, but it is important to know about all possibilities in the product.

This book contains details about the different Index types as Clustered Index, NonClustered Index, Filtered Index, columns included in an index and Columns Store Index.

Part 3 is about understanding of Joins, Indexes and how data is physical stored.

In this part of the book there are chapters on rarely used options. This subjects should be known if the need arises.

Graph and XML.

This part of the book has chaptersabout which type of Index to Create, position of the ClusterKey in a NonClustered Index, Ascending or Descending Sort Order in Indexes, Column Order in a MultiColumn Index, Index on a Foreign Key Column but also a chapter just for Fun and better understanding of indexes.

Try to understand the Join Semantic helps creating and using the index in the best way. There is chapters about LOOP, HASH and MERGE JOIN. But also a chapter for learning more about InMemory tables and indexes for this tables.

It is important to have an understanding about how the tables are defined, so there is a chapter about how to implement a Logical Data Model in several ways as a Physical Data Model.

商品描述(中文翻譯)

本書的第一部分專注於撰寫 SELECT 語句。在準備操作語句時,應該在撰寫語句之前規劃語句的結構。我們首先需要確切了解表格是如何創建的。我們需要知道每個表格和列的所有約束條件,包括數據類型、NULL/NOT NULL、主鍵、外鍵、檢查約束和觸發器。

關聯數據庫是基於數學的。因此,在規劃語句時,可以利用數學的優勢。

本書的第一部分是關於撰寫正確且性能最佳的 SELECT 語句。

本書包含以下主題:

- 理解數據庫、表格和約束的定義。
- 準備語句時必須使用的數學的簡要概述。
- 8 種代數運算 - 如何使用這些運算來撰寫正確且性能良好的語句。
- 選擇 (Selection)
- 投影 (Projection)
- 連接 (Join) - 不同連接類型的詳細回顧
- 聯合 (UNION)、交集 (INTERSECT) 和差集 (EXCEPT)
- 笛卡爾積 (Cartesian Product)
- 除法 (Divide)
- 使用代數運算的範例,特別是專注於連接多個表格,以獲得正確且可維護的結果。
- 數據分組 - GROUP BY、CUBE、ROLLUP、GROUP BY GROUPING SETS 和窗口函數 (Window Functions)。
- 子查詢 (Sub-Select)。

第二部分是關於不同的物件類型以及 SQL Server 中的索引。

SQL Server 中有許多不同的物件類型。這些在本書的第二部分中進行回顧。此外,還會回顧索引類型,重點在於理解索引的結構及其使用方式。

主題包括視圖 (Views)、PIVOT、UNPIVOT、APPLY JOIN、CTE、INSERT、DELETE、UPDATE、MERGE 和 TRUNCATE。

存儲過程 (Stored Procedure)、函數 (Function) 和觸發器 (Trigger) 的定義。時間數據 (Temporal Data) 和內存優化表 (InMemory Optimized Tables) 是重要的知識點。雖然數據遮罩 (Data Masking) 和行級安全 (Row Level Security) 可能不常用,但了解產品中的所有可能性是很重要的。

本書詳細介紹了不同的索引類型,如聚集索引 (Clustered Index)、非聚集索引 (NonClustered Index)、過濾索引 (Filtered Index)、索引中包含的列以及列存儲索引 (Columns Store Index)。

第三部分是關於理解連接 (Joins)、索引 (Indexes) 以及數據的物理存儲方式。

在本書的這一部分中,有關於不常用選項的章節。如果有需要,這些主題應該是已知的。

圖形 (Graph) 和 XML。

本書的這一部分有關於創建哪種類型的索引、非聚集索引中 ClusterKey 的位置、索引中的升序或降序排序、在多列索引中的列順序、外鍵列上的索引,以及一個僅供娛樂和更好理解索引的章節。

理解連接語義 (Join Semantic) 有助於以最佳方式創建和使用索引。這裡有關於 LOOP、HASH 和 MERGE JOIN 的章節,還有一個章節專門用於學習更多有關內存表 (InMemory tables) 和這些表的索引。

了解表格的定義是很重要的,因此有一個章節講述如何以多種方式實現邏輯數據模型 (Logical Data Model) 作為物理數據模型 (Physical Data Model)。