0% found this document useful (0 votes)
176 views161 pages

T-SQL Fundamentals, Fourth Edition Itzik Ben-Gan Digital Download

Uploaded by

mirkapopat1518
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
176 views161 pages

T-SQL Fundamentals, Fourth Edition Itzik Ben-Gan Digital Download

Uploaded by

mirkapopat1518
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

T-SQL Fundamentals, Fourth Edition Itzik Ben-Gan

digital download

Featured on [Link]
( 4.7/5.0 ★ | 496 downloads )

[Link]
itzik-ben-gan/
T-SQL Fundamentals, Fourth Edition Itzik Ben-Gan

EBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 ACADEMIC EDITION – LIMITED RELEASE

Available Instantly Access Library


We believe these products will be a great fit for you. Click
the link to download now, or visit [Link]
to discover even more!

Pro T-SQL 2022 2nd Edition Elizabeth Noble

[Link]
noble/

Computer Security Fundamentals, Fourth Edition Chuck


Easttom

[Link]
edition-chuck-easttom/

Fundamentals of Research in Criminology and Criminal


Justice Fourth Edition

[Link]
and-criminal-justice-fourth-edition/

Fracture Mechanics: Fundamentals and Applications, Fourth


Edition 4th Edition – Ebook PDF Version

[Link]
applications-fourth-edition-4th-edition-ebook-pdf-version/
Expert Performance Indexing in Azure SQL and SQL Server
2022, Fourth Edition: Toward Faster Results and Lower
Maintenance Both on Premises and in the Cloud Edward
Pollack
[Link]
sql-and-sql-server-2022-fourth-edition-toward-faster-results-and-
lower-maintenance-both-on-premises-and-in-the-cloud-edward-pollack/

GaN transistors for efficient power conversion Third


Edition De Rooij

[Link]
conversion-third-edition-de-rooij/

Easy Spanish Reader: A Three-Part Text for Beginning


Students, Premium Fourth Edition William T. Tardy

[Link]
for-beginning-students-premium-fourth-edition-william-t-tardy/

Getting Started with SQL and Databases: Managing and


Manipulating Data with SQL 1st Edition Mark Simon

[Link]
managing-and-manipulating-data-with-sql-1st-edition-mark-simon/

Pro SQL Server 2022 Wait Statistics: A Practical Guide to


Analyzing Performance in SQL Server and Azure SQL
Database, 3rd Edition Thomas Larock
[Link]
practical-guide-to-analyzing-performance-in-sql-server-and-azure-sql-
database-3rd-edition-thomas-larock/
T-SQL Fundamentals

Itzik Ben-Gan
T-SQL Fundamentals Editor-in-Chief
Published with the authorization of Microsoft Corporation by: Brett Bartow
Pearson Education, Inc. Executive Editor
Copyright © 2023 by Itzik Ben-Gan. Loretta Yates
All rights reserved. This publication is protected by copyright, and permission Associate Editor
must be obtained from the publisher prior to any prohibited reproduction,
Charvi Arora
storage in a retrieval system, or transmission in any form or by any means,
electronic, mechanical, photocopying, recording, or likewise. For information Development Editor
regarding permissions, request forms, and the appropriate contacts within Songlin Qiu
the Pearson Education Global Rights & Permissions Department, please visit
[Link]/permissions. Managing Editor
No patent liability is assumed with respect to the use of the information con- Sandra Schroeder
tained herein. Although every precaution has been taken in the preparation
Senior Project Editor
of this book, the publisher and author assume no responsibility for errors or
omissions. Nor is any liability assumed for damages resulting from the use of Tracey Croom
the information contained herein.
Copy Editor
ISBN-13: 978-0-13-810210-4
Scout Festa
ISBN-10: 0-13-810210-4
Indexer
Library of Congress Control Number: 2023930537
Erika Milllen
ScoutAutomatedPrintCode
Proofreader
Trademarks
Jen Hinchliffe
Microsoft and the trademarks listed at [Link] on the
“Trademarks” webpage are trademarks of the Microsoft group of companies. Technical Editor
All other marks are property of their respective owners. Lilach Ben-Gan
Warning and Disclaimer Editorial Assistant
Every effort has been made to make this book as complete and as accurate as Cindy Teeters
possible, but no warranty or fitness is implied. The information provided is on
an “as is” basis. The author, the publisher, and Microsoft Corporation shall have Cover Designer
neither liability nor responsibility to any person or entity with respect to any Twist Creative, Seattle
loss or damages arising from the information contained in this book or from
the use of the programs accompanying it. Compositor
codeMantra
Special Sales
For information about buying this title in bulk quantities, or for special sales
opportunities (which may include electronic versions; custom cover designs;
and content particular to your business, training goals, marketing focus, or
branding interests), please contact our corporate sales department at
corpsales@[Link] or (800) 382-3419.
For government sales inquiries, please contact
governmentsales@[Link].
For questions about sales outside the U.S., please contact
intlcs@[Link].
Pearson’s Commitment to Diversity,
Equity, and Inclusion
earson is dedicated to creating bias free content that re ects the diversity of all learners. We
embrace the many dimensions of diversity, including but not limited to race, ethnicity, gender,
socioeconomic status, ability, age, sexual orientation, and religious or political beliefs.
Education is a powerful force for equity and change in our world. It has the potential to deliver
opportunities that improve lives and enable economic mobility. As we work with authors to
create content for every product and service, we acknowledge our responsibility to dem-
onstrate inclusivity and incorporate diverse scholarship so that everyone can achieve their
potential through learning. As the world’s leading learning company, we have a duty to help
drive change and live up to our purpose to help more people create a better life for themselves
and to create a better world.
Our ambition is to purposefully contribute to a world where:
■ Everyone has an equitable and lifelong opportunity to succeed through learning.

■ Our educational products and services are inclusive and represent the rich diversity of
learners.

■ ur educational content accurately re ects the histories and experiences of the learners
we serve.

■ Our educational content prompts deeper discussions with learners and motivates them
to expand their own learning (and worldview).

While we wor hard to present unbiased content, we want to hear from you about any
concerns or needs with this Pearson product so that we can investigate and address them.
■ Please contact us with concerns about any potential bias at
[Link]
To Dato,
To live in hearts we leave behind,
Is not to die.
—THOMAS CAMPBELL
Contents at a Glance

Acknowledgments xxi
About the Author xxiii
Introduction xxiv

CHAPTER 1 Background to T-SQL querying and programming 1


CHAPTER 2 Single-table queries 27
CHAPTER 3 Joins 117
CHAPTER 4 Subqueries 149
CHAPTER 5 Table expressions 177
CHAPTER 6 Set operators 211
CHAPTER 7 T-SQL for data analysis 231
CHAPTER 8 Data difi ati n 293
CHAPTER 9 Temporal tables 343
CHAPTER 10 Transactions and concurrency 367
CHAPTER 11 SQL Graph 409
CHAPTER 12 Programmable objects 491

Appendix: Getting started 527

Index 547
Contents
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv

Chapter 1 Background to T-SQL querying and programming 1


Theoretical background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Set theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Predicate logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
The relational model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Types of database workloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11

SQL Server architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13


n premises and cloud D S avors . . . . . . . . . . . . . . . . . . . . . . . . . . 13
SQL Server instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Schemas and objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

reating tables and defining data integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20


Creating tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Defining data integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Chapter 2 Single-table queries 27


Elements of the SELECT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
The FROM clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
The WHERE clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
The GROUP BY clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
The HAVING clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
The SELECT clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
The ORDER BY clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
The TOP and OFFSET-FETCH filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
A quick look at window functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

ix
Predicates and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

CASE expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

NULLs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

The GREATEST and LEAST functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

All-at-once operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

Wor ing with character data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64


Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64
Collation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Operators and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
The LIKE predicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

Wor ing with date and time data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83


Date and time data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Wor ing with date and time separately . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Filtering date ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Date and time functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

Querying metadata. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103


Catalog views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Information schema views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
System stored procedures and functions . . . . . . . . . . . . . . . . . . . . . . . . 105

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111

x Contents
Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

Chapter 3 Joins 117


Cross joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
SQL-92 syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
SQL-89 syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Self cross joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Producing tables of numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

Inner joins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121


SQL-92 syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
SQL-89 syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Inner join safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

More join examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124


Composite joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Non-equi joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Multi-join queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

Outer joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128


Outer joins, described . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Including missing values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Filtering attributes from the nonpreserved side
of an outer join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Using outer joins in a multi-join query . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Using the COUNT aggregate with outer joins . . . . . . . . . . . . . . . . . . . 136

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

Contents xi
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Exercise 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Exercise 1-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Exercise 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Exercise 1-2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

Chapter 4 Subqueries 149


Self-contained subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Self-contained scalar subquery examples . . . . . . . . . . . . . . . . . . . . . . . 149
Self-contained multivalued subquery examples . . . . . . . . . . . . . . . . . 151

Correlated subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155


The EXISTS predicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Returning previous or next values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Using running aggregates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Dealing with misbehaving subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
NULL trouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Substitution errors in subquery column names . . . . . . . . . . . . . . . . . . 163
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
xii Contents
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Exercise 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Exercise 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

Chapter 5 Table expressions 177


Derived tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Assigning column aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Using arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Nesting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Multiple references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

Common table expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183


Assigning column aliases in CTEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Using arguments in CTEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Defining multiple TEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Multiple references in CTEs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Recursive CTEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Contents xiii
Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Views and the ORDER BY clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
View options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192

Inline table-valued functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

The APPLY operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .200

Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Exercise 2-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Exercise 2-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202
Exercise 3-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202
Exercise 3-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203
Exercise 5-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203
Exercise 5-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204
Exercise 6-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205
Exercise 6-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206
Exercise 2-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206
Exercise 2-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206
Exercise 3-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207
Exercise 3-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207
Exercise 5-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
Exercise 5-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
Exercise 6-1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209
Exercise 6-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209

Chapter 6 Set operators 211


The UNION operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
The UNION ALL operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
The UNION (DISTINCT) operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

xiv Contents
The INTERSECT operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
The INTERSECT (DISTINCT) operator . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
The INTERSECT ALL operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

The EXCEPT operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217


The EXCEPT (DISTINCT) operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
The EXCEPT ALL operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220

Circumventing unsupported logical phases . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223

Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .226

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .228
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .228
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230

Chapter 7 T-SQL for data analysis 231


Window functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Ranking window functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .234
Offset window functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .237
Aggregate window functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242
The WINDOW clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244

Pivoting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .246


Pivoting with a grouped query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248
Pivoting with the PIVOT operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249

Contents xv
Unpivoting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Unpivoting with the APPLY operator . . . . . . . . . . . . . . . . . . . . . . . . . . . .253
Unpivoting with the UNPIVOT operator. . . . . . . . . . . . . . . . . . . . . . . . .255

Grouping sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .256


The GROUPING SETS subclause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258
The CUBE subclause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258
The ROLLUP subclause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258
The GROUPING and GROUPING_ID functions . . . . . . . . . . . . . . . . . .260

Time series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .262


Sample data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .263
The DATE_BUCKET function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266
Custom computation of start of containing bucket . . . . . . . . . . . . . .268
Applying bucket logic to sample data . . . . . . . . . . . . . . . . . . . . . . . . . . .270
Gap filling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .275

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .280

Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .280
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .280
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .283
Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284
Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .287
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .288
Exercise 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .289
Exercise 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .290

xvi Contents
Chapter 8 Data modification 293
Inserting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .293
The INSERT VALUES statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .293
The INSERT SELECT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .295
The INSERT EXEC statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .296
The SELECT INTO statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .297
The BULK INSERT statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .298
The identity property and the sequence object. . . . . . . . . . . . . . . . . .298

Deleting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .307


The DELETE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .308
The TRUNCATE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .309
DELETE based on a join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310

Updating data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311


The UPDATE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
UPDATE based on a join. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Assignment UPDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .316

Merging data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

Modifying data through table expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321

odifications with TOP and OFFSET-FETCH . . . . . . . . . . . . . . . . . . . . . . . . . . 324

The OUTPUT clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .326


INSERT with OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
DELETE with OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
UPDATE with OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
MERGE with OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Nested DML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .333

Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .333
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .333
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .334
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .334
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .334
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .336
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .336

Contents xvii
Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .337
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .337
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .338
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .339
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .340
Exercise 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .340
Exercise 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

Chapter 9 Temporal tables 343


Creating tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

Modifying data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .348

Querying data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .353

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360

Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .364
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .365
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366

Chapter 10 Transactions and concurrency 367


Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .367

Locks and blocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .370


Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Troubleshooting blocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .373

Isolation levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .380


The READ UNCOMMITTED isolation level . . . . . . . . . . . . . . . . . . . . . . . 381
The READ COMMITTED isolation level . . . . . . . . . . . . . . . . . . . . . . . . . .382
The REPEATABLE READ isolation level . . . . . . . . . . . . . . . . . . . . . . . . . . .384
The SERIALIZABLE isolation level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .386
xviii Contents
Isolation levels based on row versioning . . . . . . . . . . . . . . . . . . . . . . . .387
Summary of isolation levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .394

Deadlocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .394

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .397

Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .397
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .397
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .407

Chapter 11 SQL Graph 409


Creating tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Traditional modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Graph modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417

Querying data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .438


Using the MATCH clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .438
Recursive queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .450
Using the SHORTEST_PATH option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .454
SQL Graph querying features that are still missing . . . . . . . . . . . . . . . 471

Data modification considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474


Deleting and updating data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Merging data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .477

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .480

Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .482
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .483
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .483

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .485
Exercise 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .487
Exercise 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .488

Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .490

Contents xix
Chapter 12 Programmable objects 491
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491

Batches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .494
A batch as a unit of parsing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .494
Batches and variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .495
Statements that cannot be combined in the same batch . . . . . . . . .495
A batch as a unit of resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .496
The GO n option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .496

Flow elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497


The IF . . . ELSE ow element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497
The WHILE ow element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .498

Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .500

Temporary tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .505


Local temporary tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .505
Global temporary tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .507
Table variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .508
Table types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .509

Dynamic SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510


The EXEC command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
The sp_executesql stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
Using PIVOT with Dynamic SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512

Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
User defined functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517

Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .525

Appendix: Getting started 527

Index 547

xx Contents
Acknowledgments

A number of people contributed to making this book a reality, either directly or indi-
rectly, and deserve thanks and recognition. It’s certainly possible I omitted some names
unintentionally, and I apologize for this ahead of time.

To Lilach: You’re the one who makes me want to be good at what I do. Besides being
my inspiration in life, you always take an active role in my books, helping to review the
text for the first time. In this boo , you too a more official technical editing role, and I
can’t appreciate enough the errors you spotted, and the many ideas and suggestions for
improvements.

To my siblings, Mickey and Ina: Thank you for the constant support and for accepting
the fact that I’m away.

To Davide Mauri, Herbert Albert, Gianluca Hotz, and Dejan Sarka: Thanks for your
valuable advice when I reached out asking for it.

To the editorial team at Pearson and related vendors. Loretta Yates, many thanks for
being so good at what you do and for your positive attitude! Thanks to Charvi Arora for all
your hard work and effort. Also, thanks to Songlin Qiu, Scout Festa, Karthik Orukaimani,
and Tracey Croom for sifting through all the text and making sure it’s polished.

To my friends from Lucient, Fernando G. Guerrero, Herbert Albert, Fritz Lechnitz, and
many others. We ve been wor ing together for over two decades, and it s been quite a
ride!

To members of the Microsoft SQL Server development team, Umachandar Jayachan-


dran (UC), Conor Cunningham, Kevin Farlee, Craig Freedman, Kendal Van Dyke, Derek
Wilson, Davide auri, ob Ward, uc Woody, and I m sure many others. Than s for
creating such a great product, and thanks for all the time you spent meeting with me
and responding to my emails, addressing my questions, and answering my requests for
clarification.

To aron ertrand, who besides being one of the most active and prolific S Server
pros I know, does an amazing job editing the [Link] content, including my
articles.

To Data Platform MVPs, past and present: Erland Sommarskog, Aaron Bertrand, Hugo
ornelis, aul White, le andro esa, Tibor aras i, Simon Sabin, Denis e ni , Tony
Rogerson, and many others—and to the Data Platform MVP lead, Rie Merritt. This is a
great program that I’m grateful for and proud to be part of. The level of expertise of this

xxi
Random documents with unrelated
content Scribd suggests to you:
Artificial Intelligence - Teaching Resources
First 2024 - Center

Prepared by: Teacher Jones


Date: July 28, 2025

Review 1: Study tips and learning strategies


Learning Objective 1: Research findings and conclusions
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Learning Objective 2: Key terms and definitions
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Learning Objective 3: Ethical considerations and implications
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Learning Objective 4: Research findings and conclusions
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Learning Objective 5: Interdisciplinary approaches
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Practice Problem 5: Statistical analysis and interpretation
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Theoretical framework and methodology
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Remember: Historical development and evolution
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 8: Diagram/Chart/Graph]
Note: Statistical analysis and interpretation
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Statistical analysis and interpretation
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Results 2: Historical development and evolution
Example 10: Literature review and discussion
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 11: Ethical considerations and implications
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Practice Problem 12: Current trends and future directions
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Current trends and future directions
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Practice Problem 14: Research findings and conclusions
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Note: Research findings and conclusions
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Remember: Practical applications and examples
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Definition: Study tips and learning strategies
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Critical analysis and evaluation
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Critical analysis and evaluation
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Results 3: Learning outcomes and objectives
Definition: Theoretical framework and methodology
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Key Concept: Literature review and discussion
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Remember: Assessment criteria and rubrics
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Interdisciplinary approaches
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Definition: Current trends and future directions
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Definition: Fundamental concepts and principles
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Problem-solving strategies and techniques
• Interdisciplinary approaches
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Learning outcomes and objectives
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
[Figure 28: Diagram/Chart/Graph]
Definition: Historical development and evolution
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 29: Ethical considerations and implications
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Introduction 4: Statistical analysis and interpretation
Example 30: Study tips and learning strategies
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Study tips and learning strategies
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Practice Problem 32: Theoretical framework and methodology
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
[Figure 33: Diagram/Chart/Graph]
Key Concept: Current trends and future directions
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 34: Diagram/Chart/Graph]
Remember: Comparative analysis and synthesis
• Theoretical framework and methodology
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Critical analysis and evaluation
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 36: Diagram/Chart/Graph]
Practice Problem 36: Assessment criteria and rubrics
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 37: Critical analysis and evaluation
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Historical development and evolution
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Key terms and definitions
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 40: Diagram/Chart/Graph]
Appendix 5: Fundamental concepts and principles
Practice Problem 40: Critical analysis and evaluation
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Example 41: Theoretical framework and methodology
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Example 42: Case studies and real-world applications
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 43: Diagram/Chart/Graph]
Important: Problem-solving strategies and techniques
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Interdisciplinary approaches
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 45: Diagram/Chart/Graph]
Definition: Current trends and future directions
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Important: Best practices and recommendations
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Note: Current trends and future directions
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 48: Diagram/Chart/Graph]
Example 48: Comparative analysis and synthesis
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Remember: Comparative analysis and synthesis
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Practice 6: Assessment criteria and rubrics
Note: Critical analysis and evaluation
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 51: Diagram/Chart/Graph]
Remember: Key terms and definitions
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Comparative analysis and synthesis
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Best practices and recommendations
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Note: Assessment criteria and rubrics
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 55: Diagram/Chart/Graph]
Definition: Comparative analysis and synthesis
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Case studies and real-world applications
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Fundamental concepts and principles
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 58: Current trends and future directions
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 59: Diagram/Chart/Graph]
Remember: Practical applications and examples
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
References 7: Comparative analysis and synthesis
Remember: Comparative analysis and synthesis
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Practice Problem 61: Learning outcomes and objectives
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 62: Research findings and conclusions
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Key Concept: Ethical considerations and implications
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Note: Interdisciplinary approaches
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Practice Problem 65: Critical analysis and evaluation
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 66: Diagram/Chart/Graph]
Definition: Current trends and future directions
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
[Figure 67: Diagram/Chart/Graph]
Important: Experimental procedures and results
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Current trends and future directions
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Important: Current trends and future directions
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Part 8: Critical analysis and evaluation
Important: Research findings and conclusions
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Historical development and evolution
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Note: Comparative analysis and synthesis
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Theoretical framework and methodology
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Ethical considerations and implications
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Problem-solving strategies and techniques
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 76: Learning outcomes and objectives
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 77: Diagram/Chart/Graph]
Key Concept: Learning outcomes and objectives
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Key Concept: Best practices and recommendations
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 79: Diagram/Chart/Graph]
Example 79: Case studies and real-world applications
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Topic 9: Study tips and learning strategies
Note: Statistical analysis and interpretation
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Case studies and real-world applications
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
[Figure 82: Diagram/Chart/Graph]
Note: Current trends and future directions
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Key Concept: Ethical considerations and implications
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Note: Assessment criteria and rubrics
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Note: Experimental procedures and results
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Definition: Historical development and evolution
• Literature review and discussion
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Study tips and learning strategies
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Practice Problem 88: Problem-solving strategies and techniques
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Note: Current trends and future directions
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Introduction 10: Current trends and future directions
Important: Case studies and real-world applications
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Example 91: Historical development and evolution
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Note: Practical applications and examples
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Study tips and learning strategies
• Theoretical framework and methodology
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Remember: Key terms and definitions
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Current trends and future directions
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 96: Diagram/Chart/Graph]
Definition: Learning outcomes and objectives
• Historical development and evolution
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Study tips and learning strategies
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Statistical analysis and interpretation
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Note: Ethical considerations and implications
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Background 11: Interdisciplinary approaches
Key Concept: Case studies and real-world applications
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Interdisciplinary approaches
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 102: Diagram/Chart/Graph]
Remember: Learning outcomes and objectives
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Note: Case studies and real-world applications
• Historical development and evolution
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Example 104: Key terms and definitions
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Key Concept: Interdisciplinary approaches
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 106: Diagram/Chart/Graph]
Important: Assessment criteria and rubrics
• Theoretical framework and methodology
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 107: Research findings and conclusions
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Best practices and recommendations
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 109: Diagram/Chart/Graph]
Key Concept: Assessment criteria and rubrics
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Section 12: Fundamental concepts and principles
Important: Critical analysis and evaluation
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Definition: Assessment criteria and rubrics
• Historical development and evolution
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Note: Practical applications and examples
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 113: Statistical analysis and interpretation
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 114: Diagram/Chart/Graph]
Definition: Comparative analysis and synthesis
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 115: Diagram/Chart/Graph]
Key Concept: Assessment criteria and rubrics
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 116: Diagram/Chart/Graph]
Practice Problem 116: Comparative analysis and synthesis
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 117: Diagram/Chart/Graph]
Practice Problem 117: Literature review and discussion
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Note: Practical applications and examples
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 119: Interdisciplinary approaches
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Abstract 13: Current trends and future directions
Definition: Critical analysis and evaluation
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Example 121: Statistical analysis and interpretation
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Experimental procedures and results
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 123: Diagram/Chart/Graph]
Example 123: Ethical considerations and implications
• Literature review and discussion
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Definition: Experimental procedures and results
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Comparative analysis and synthesis
• Literature review and discussion
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Practical applications and examples
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Case studies and real-world applications
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Practice Problem 128: Fundamental concepts and principles
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
[Figure 129: Diagram/Chart/Graph]
Important: Problem-solving strategies and techniques
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 130: Diagram/Chart/Graph]
Review 14: Practical applications and examples
Important: Best practices and recommendations
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 131: Current trends and future directions
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

[Link]

You might also like