Foreword |
|
xix | |
About the Author |
|
xxii | |
About the Technical Reviewer |
|
xxiii | |
Acknowledgments |
|
xxv | |
Introduction |
|
xxvii | |
|
Chapter 1 The Fundamentals |
|
|
1 | (36) |
|
Taking a Brief Jaunt Through History |
|
|
2 | (7) |
|
Introducing Codd's Rules for an RDBMS |
|
|
3 | (5) |
|
|
8 | (1) |
|
Recognizing Relational Data Structures |
|
|
9 | (15) |
|
Introducing Databases and Schemas |
|
|
10 | (1) |
|
Understanding Tables, Rows, and Columns |
|
|
10 | (5) |
|
Working with Missing Values (NULLs) |
|
|
15 | (1) |
|
|
16 | (1) |
|
|
17 | (1) |
|
Assigning Uniqueness Constraints (Keys) |
|
|
18 | (6) |
|
Understanding Relationships |
|
|
24 | (6) |
|
Working with Binary Relationships |
|
|
26 | (3) |
|
Working with Nonbinary Relationships |
|
|
29 | (1) |
|
Understanding Dependencies |
|
|
30 | (1) |
|
Working with Functional Dependencies |
|
|
30 | (1) |
|
Working with Determinants |
|
|
31 | (1) |
|
|
31 | (1) |
|
Outlining the Database-Specific Project Phases |
|
|
32 | (3) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
35 | (1) |
|
|
35 | (2) |
|
Chapter 2 Introduction to Requirements |
|
|
37 | (16) |
|
|
39 | (2) |
|
|
41 | (1) |
|
|
42 | (1) |
|
Asking the Right Questions |
|
|
43 | (5) |
|
|
43 | (1) |
|
How Will the Data Be Used? |
|
|
44 | (1) |
|
What Rules Govern the Use of the Data? |
|
|
44 | (1) |
|
What Data Is Reported On? |
|
|
45 | (1) |
|
|
46 | (1) |
|
Will the Data Need to Be Integrated with Other Systems? |
|
|
47 | (1) |
|
How Much Is This Data Worth? |
|
|
47 | (1) |
|
|
47 | (1) |
|
Working with Existing Systems and Prototypes |
|
|
48 | (1) |
|
Utilizing Other Types of Documentation |
|
|
48 | (2) |
|
Early Project Documentation |
|
|
49 | (1) |
|
Contracts or Client Work Orders |
|
|
49 | (1) |
|
Level of Service Agreement |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
50 | (1) |
|
|
50 | (3) |
|
Chapter 3 The Language of Data Modeling |
|
|
53 | (38) |
|
Introducing Data Modeling |
|
|
54 | (1) |
|
|
55 | (3) |
|
|
58 | (9) |
|
|
59 | (2) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (2) |
|
|
65 | (2) |
|
|
67 | (14) |
|
Identifying Relationships |
|
|
68 | (1) |
|
Nonidentifying Relationships |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
72 | (7) |
|
Verb Phrases (Relationship Names) |
|
|
79 | (2) |
|
|
81 | (1) |
|
Alternative Modeling Methodologies |
|
|
82 | (6) |
|
|
83 | (2) |
|
|
85 | (1) |
|
|
86 | (1) |
|
Management Studio Database Diagrams |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
89 | (2) |
|
Chapter 4 Initial Data Model Production |
|
|
91 | (38) |
|
|
92 | (1) |
|
|
93 | (9) |
|
|
94 | (1) |
|
|
95 | (1) |
|
|
95 | (1) |
|
|
96 | (1) |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
99 | (1) |
|
|
100 | (2) |
|
Relationships between Entities |
|
|
102 | (7) |
|
|
102 | (4) |
|
Many-to-Many Relationships |
|
|
106 | (1) |
|
|
107 | (2) |
|
Identifying Attributes and Domains |
|
|
109 | (11) |
|
|
111 | (2) |
|
|
113 | (1) |
|
|
113 | (2) |
|
|
115 | (1) |
|
|
116 | (1) |
|
A List of Entities, Attributes, and Domains |
|
|
117 | (3) |
|
Identifying Business Rules |
|
|
120 | (2) |
|
Identifying Fundamental Processes |
|
|
122 | (2) |
|
The Intermediate Version of the Logical Model |
|
|
124 | (2) |
|
Identifying Obvious Additional Data Needs |
|
|
124 | (1) |
|
|
125 | (1) |
|
Repeat Until the Customer Agrees with Your Model |
|
|
126 | (1) |
|
|
126 | (1) |
|
|
127 | (2) |
|
|
129 | (40) |
|
The Process of Normalization |
|
|
130 | (1) |
|
|
131 | (13) |
|
All Columns Must Be Atomic |
|
|
131 | (8) |
|
All Rows Must Contain the Same Number of Values |
|
|
139 | (2) |
|
All Rows Must Be Different |
|
|
141 | (2) |
|
Clues That an Existing Design Is Not in First Normal Form |
|
|
143 | (1) |
|
Relationships Between Columns |
|
|
144 | (5) |
|
|
144 | (2) |
|
|
146 | (1) |
|
|
147 | (2) |
|
Surrogate Keys Effect on Dependency |
|
|
149 | (7) |
|
|
151 | (1) |
|
Clues That Your Database Is Not in BCNF |
|
|
152 | (3) |
|
|
155 | (1) |
|
Tables with Multiple Meanings |
|
|
156 | (6) |
|
Fourth Normal Form: Independent Multivalued Dependencies |
|
|
157 | (2) |
|
|
159 | (3) |
|
|
162 | (3) |
|
|
165 | (1) |
|
|
165 | (2) |
|
The Story of the Book So Far |
|
|
167 | (2) |
|
Chapter 6 Physical Model Implementation Case Study |
|
|
169 | (76) |
|
|
172 | (5) |
|
|
173 | (2) |
|
|
175 | (1) |
|
|
176 | (1) |
|
Choosing Key Implementation |
|
|
177 | (7) |
|
|
177 | (5) |
|
|
182 | (2) |
|
Determining Domain Implementation |
|
|
184 | (16) |
|
Implement as a Column or Table? |
|
|
186 | (2) |
|
|
188 | (10) |
|
|
198 | (1) |
|
|
199 | (1) |
|
|
200 | (1) |
|
Adding Implementation Columns |
|
|
201 | (1) |
|
Using DDL to Create the Database |
|
|
202 | (35) |
|
Creating the Basic Table Structures |
|
|
204 | (10) |
|
Adding Uniqueness Constraints |
|
|
214 | (4) |
|
Building Default Constraints |
|
|
218 | (1) |
|
Adding Relationships (Foreign Keys) |
|
|
219 | (5) |
|
Adding Basic Check Constraints |
|
|
224 | (2) |
|
Triggers to Maintain Automatic Values |
|
|
226 | (4) |
|
Documenting Your Database |
|
|
230 | (3) |
|
Viewing the Basic Metadata |
|
|
233 | (4) |
|
Unit Testing Your Structures |
|
|
237 | (4) |
|
|
241 | (1) |
|
|
242 | (3) |
|
Chapter 7 Data Protection with Check Constraints and Triggers |
|
|
245 | (56) |
|
|
247 | (13) |
|
CHECK Constraints Based on Simple Expressions |
|
|
252 | (2) |
|
CHECK Constraints Using Functions |
|
|
254 | (4) |
|
Enhancing Errors Caused by Constraints |
|
|
258 | (2) |
|
|
260 | (32) |
|
|
261 | (18) |
|
Relationships That Span Databases and Servers |
|
|
279 | (4) |
|
|
283 | (9) |
|
Dealing with Triggers and Constraints Errors |
|
|
292 | (5) |
|
|
297 | (1) |
|
|
298 | (3) |
|
Chapter 8 Patterns and Anti-Patterns |
|
|
301 | (70) |
|
|
302 | (30) |
|
|
302 | (17) |
|
|
319 | (1) |
|
|
320 | (12) |
|
Images, Documents, and Other Files, Oh My |
|
|
332 | (27) |
|
|
340 | (5) |
|
Storing User-Specified Data |
|
|
345 | (14) |
|
|
359 | (9) |
|
|
360 | (1) |
|
One-Size-Fits-All Key Domain |
|
|
361 | (3) |
|
|
364 | (3) |
|
Overusing Unstructured Data |
|
|
367 | (1) |
|
|
368 | (3) |
|
Chapter 9 Database Security and Security Patterns |
|
|
371 | (74) |
|
Database Access Prerequisites |
|
|
372 | (14) |
|
Guidelines for Server Security |
|
|
373 | (1) |
|
Principals and Securables |
|
|
374 | (1) |
|
|
375 | (1) |
|
|
376 | (3) |
|
Using the Contained Database Model |
|
|
379 | (4) |
|
|
383 | (3) |
|
|
386 | (16) |
|
|
387 | (1) |
|
Controlling Access to Objects |
|
|
388 | (4) |
|
|
392 | (8) |
|
|
400 | (2) |
|
Controlling Access to Data via T-SQL-Coded Objects |
|
|
402 | (15) |
|
Stored Procedures and Scalar Functions |
|
|
402 | (2) |
|
Impersonation within Objects |
|
|
404 | (6) |
|
Views and Table-Valued Functions |
|
|
410 | (7) |
|
|
417 | (10) |
|
Using Cross-Database Chaining |
|
|
418 | (5) |
|
Using Impersonation to Cross Database Lines |
|
|
423 | (1) |
|
Using a Certificate-Based Trust |
|
|
424 | (2) |
|
Different Server (Distributed Queries) |
|
|
426 | (1) |
|
|
427 | (2) |
|
|
429 | (13) |
|
Server and Database Audit |
|
|
430 | (4) |
|
Watching Table History Using DML Triggers |
|
|
434 | (4) |
|
|
438 | (3) |
|
|
441 | (1) |
|
|
442 | (1) |
|
|
443 | (2) |
|
Chapter 10 Table Structures and Indexing |
|
|
445 | (60) |
|
Physical Database Structure |
|
|
447 | (12) |
|
|
447 | (3) |
|
|
450 | (3) |
|
|
453 | (3) |
|
|
456 | (3) |
|
|
459 | (1) |
|
|
460 | (2) |
|
|
462 | (2) |
|
|
462 | (1) |
|
|
463 | |
|
Nonclustered Indexes on Clustered Tables |
|
|
461 | (1) |
|
Nonclustered Indexes on a Heap |
|
|
462 | (2) |
|
|
464 | (2) |
|
Basic Index Usage Patterns |
|
|
466 | (18) |
|
|
467 | (4) |
|
Using Nonclustered Indexes |
|
|
471 | (13) |
|
|
484 | (1) |
|
Advanced Index Usage Scenarios |
|
|
484 | (13) |
|
|
489 | (4) |
|
|
493 | (4) |
|
Index Dynamic Management View Queries |
|
|
497 | (4) |
|
|
497 | (3) |
|
Index Utilization Statistics |
|
|
500 | (1) |
|
|
501 | (1) |
|
|
501 | (2) |
|
|
503 | (2) |
|
Chapter 11 Coding for Concurrency |
|
|
505 | (58) |
|
|
506 | (2) |
|
|
508 | (1) |
|
|
509 | (18) |
|
|
510 | (8) |
|
|
518 | (9) |
|
|
527 | (19) |
|
|
528 | (5) |
|
|
533 | (13) |
|
Coding for Integrity and Concurrency |
|
|
546 | (14) |
|
|
546 | (3) |
|
Implementing a Single-Threaded Code Block |
|
|
549 | (3) |
|
|
552 | (1) |
|
|
553 | (5) |
|
|
558 | (2) |
|
|
560 | (1) |
|
|
561 | (2) |
|
Chapter 12 Reusable Standard Database Components |
|
|
563 | (32) |
|
|
564 | (12) |
|
Determining the Contents of a String |
|
|
568 | (2) |
|
Finding Gaps in a Sequence of Numbers |
|
|
570 | (1) |
|
Separating Comma Delimited Items |
|
|
571 | (2) |
|
|
573 | (3) |
|
|
576 | (9) |
|
|
585 | (5) |
|
|
586 | (2) |
|
|
588 | (2) |
|
|
590 | (2) |
|
|
592 | (1) |
|
|
593 | (2) |
|
Chapter 13 Considering Data Access Strategies |
|
|
595 | (44) |
|
|
597 | (16) |
|
|
597 | (10) |
|
|
607 | (6) |
|
|
613 | (16) |
|
|
614 | (2) |
|
|
616 | (3) |
|
|
619 | (2) |
|
|
621 | (2) |
|
|
623 | (4) |
|
All Things Considered... What Do I Choose? |
|
|
627 | (2) |
|
|
629 | (8) |
|
Guidelines for Choosing T-SQL |
|
|
633 | (1) |
|
Guidelines for Choosing a CLR Object |
|
|
634 | (1) |
|
|
634 | (3) |
|
|
637 | (1) |
|
|
638 | (1) |
|
Chapter 14 Reporting Design |
|
|
639 | (32) |
|
|
639 | (2) |
|
|
640 | (1) |
|
|
641 | (1) |
|
Requirements-Gathering Process |
|
|
641 | (1) |
|
Dimensional Modeling for Analytical Reporting |
|
|
642 | (19) |
|
|
644 | (11) |
|
|
655 | (6) |
|
|
661 | (3) |
|
|
661 | (2) |
|
|
663 | (1) |
|
Summary Modeling for Aggregation Reporting |
|
|
664 | (3) |
|
|
665 | (2) |
|
Additional Summary Tables |
|
|
667 | (1) |
|
|
667 | (3) |
|
|
668 | (1) |
|
|
669 | (1) |
|
|
670 | (1) |
Appendix A |
|
671 | (36) |
Appendix B |
|
707 | (28) |
Index |
|
735 | |