Contents

Foreword

About the Author

About the Technical Reviewer

Acknowledgments

Introduction

image Chapter 1: The Fundamentals

Taking a Brief Jaunt Through History

Introducing Codd’s Rules for an RDBMS

Nodding at SQL Standards

Recognizing Relational Data Structures

Introducing Databases and Schemas

Understanding Tables, Rows, and Columns

Working with Missing Values (NULLs)

Defining Domains

Storing Metadata

Assigning Uniqueness Constraints (Keys)

Understanding Relationships

Working with Binary Relationships

Working with Nonbinary Relationships

Understanding Dependencies

Working with Functional Dependencies

Working with Determinants

Relational Programming

Outlining the Database-Specific Project Phases

Conceptual Phase

Logical Phase

Physical

Storage Phase

Summary

image Chapter 2: Introduction to Requirements

Documenting Requirements

Gathering Requirements

Interviewing Clients

Asking the Right Questions

What Data Is Needed?

How Will the Data Be Used?

What Rules Govern the Use of the Data?

What Data Is Reported On?

Where Is the Data Now?

Will the Data Need to Be Integrated with Other Systems?

How Much Is This Data Worth?

Who Will Use the Data?

Working with Existing Systems and Prototypes

Utilizing Other Types of Documentation

Early Project Documentation

Contracts or Client Work Orders

Level of Service Agreement

Audit Plans

Following Best Practices

Summary

image Chapter 3: The Language of Data Modeling

Introducing Data Modeling

Entities

Attributes

Primary Keys

Alternate Keys

Foreign Keys

Domains

Naming

Relationships

Identifying Relationships

Nonidentifying Relationships

Role Names

Relationship Cardinality

Verb Phrases (Relationship Names)

Descriptive Information

Alternative Modeling Methodologies

Information Engineering

Chen ERD

Visio

Management Studio Database Diagrams

Best Practices

Summary

image Chapter 4: Initial Data Model Production

Example Scenario

Identifying Entities

People

Places

Objects

Ideas

Documents

Groups

Other Entities

Entity Recap

Relationships between Entities

One-to-N Relationships

Many-to-Many Relationships

Listing Relationships

Identifying Attributes and Domains

Identifiers

Descriptive Information

Locators

Values

Relationship Attributes

A List of Entities, Attributes, and Domains

Identifying Business Rules

Identifying Fundamental Processes

The Intermediate Version of the Logical Model

Identifying Obvious Additional Data Needs

Review with the Client

Repeat Until the Customer Agrees with Your Model

Best Practices

Summary

image Chapter 5: Normalization

The Process of Normalization

Table and Column Shape

All Columns Must Be Atomic

All Rows Must Contain the Same Number of Values

All Rows Must Be Different

Clues That an Existing Design Is Not in First Normal Form

Relationships Between Columns

BCNF Defined

Partial Key Dependency

Entire Key Dependency

Surrogate Keys Effect on Dependency

Dependency Between Rows

Clues That Your Database Is Not in BCNF

Positional Meaning

Tables with Multiple Meanings

Fourth Normal Form: Independent Multivalued Dependencies

Fifth Normal Form

Denormalization

Best Practices

Summary

The Story of the Book So Far

image Chapter 6: Physical Model Implementation Case Study

Choosing Names

Table Naming

Naming Columns

Model Name Adjustments

Choosing Key Implementation

Primary Key

Alternate Keys

Determining Domain Implementation

Implement as a Column or Table?

Choosing the Datatype

Choosing Nullability

Choosing a Collation

Setting Up Schemas

Adding Implementation Columns

Using DDL to Create the Database

Creating the Basic Table Structures

Adding Uniqueness Constraints

Building Default Constraints

Adding Relationships (Foreign Keys)

Adding Basic Check Constraints

Triggers to Maintain Automatic Values

Documenting Your Database

Viewing the Basic Metadata

Unit Testing Your Structures

Best Practices

Summary

image Chapter 7: Data Protection with Check Constraints and Triggers

Check Constraints

CHECK Constraints Based on Simple Expressions

CHECK Constraints Using Functions

Enhancing Errors Caused by Constraints

DML Triggers

AFTER Triggers

Relationships That Span Databases and Servers

INSTEAD OF Triggers

Dealing with Triggers and Constraints Errors

Best Practices

Summary

image Chapter 8: Patterns and Anti-Patterns

Desirable Patterns

Uniqueness

Data-Driven Design

Hierarchies

Images, Documents, and Other Files, Oh My

Generalization

Storing User-Specified Data

Anti-Patterns

Undecipherable Data

One-Size-Fits-All Key Domain

Generic Key References

Overusing Unstructured Data

Summary

image Chapter 9: Database Security and Security Patterns

Database Access Prerequisites

Guidelines for Server Security

Principals and Securables

Connecting to the Server

Using Login and User

Using the Contained Database Model

Impersonation

Database Securables

Grantable Permissions

Controlling Access to Objects

Roles

Schemas

Controlling Access to Data via T-SQL-Coded Objects

Stored Procedures and Scalar Functions

Impersonation within Objects

Views and Table-Valued Functions

Crossing Database Lines

Using Cross-Database Chaining

Using Impersonation to Cross Database Lines

Using a Certificate-Based Trust

Different Server (Distributed Queries)

Obfuscating Data

Monitoring and Auditing

Server and Database Audit

Watching Table History Using DML Triggers

DDL Triggers

Logging with Profiler

Best Practices

Summary

image Chapter 10: Table Structures and Indexing

Physical Database Structure

Files and Filegroups

Extents and Pages

Data on Pages

Partitioning

Indexes Overview

Basic Index Structure

Index Types

Clustered Indexes

Nonclustered Indexes

Nonclustered Indexes on Clustered Tables

Nonclustered Indexes on a Heap

Basics of Index Creation

Basic Index Usage Patterns

Using Clustered Indexes

Using Nonclustered Indexes

Using Unique Indexes

Advanced Index Usage Scenarios

Indexing Foreign Keys

Indexing Views

Index Dynamic Management View Queries

Missing Indexes

Index Utilization Statistics

Fragmentation

Best Practices

Summary

image Chapter 11: Coding for Concurrency

What Is Concurrency?

OS and Hardware Concerns

Transactions

Transaction Syntax

Compiled SQL Server Code

Isolating Sessions

Locks

Isolation Levels

Coding for Integrity and Concurrency

Pessimistic Locking

Implementing a Single-Threaded Code Block

Optimistic Locking

Row-Based Locking

Logical Unit of Work

Best Practices

Summary

image Chapter 12: Reusable Standard Database Components

Numbers Table

Determining the Contents of a String

Finding Gaps in a Sequence of Numbers

Separating Comma Delimited Items

Stupid Mathematic Tricks

Calendar Table

Utility Objects

Monitoring Objects

Extended DDL Utilities

Logging Objects

Other Possibilities...

Summary

image Chapter 13: Considering Data Access Strategies

Ad Hoc SQL

Advantages

Pitfalls

Stored Procedures

Encapsulation

Dynamic Procedures

Security

Performance

Pitfalls

All Things Considered...What Do I Choose?

T-SQL and the CLR

Guidelines for Choosing T-SQL

Guidelines for Choosing a CLR Object

CLR Object Types

Best Practices

Summary

image Chapter 14: Reporting Design

Reporting Styles

Analytical Reporting

Aggregation Reporting

Requirements-Gathering Process

Dimensional Modeling for Analytical Reporting

Dimensions

Facts

Analytical Querying

Queries

Indexing

Summary Modeling for Aggregation Reporting

Initial Summary Table

Additional Summary Tables

Aggregation Querying

Queries

Indexing

Summary

image Appendix A

image Appendix B

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.103.77