Microsoft sql server 2019 a beginners guide dusan petkovic

Page 1

Visit to download the full and correct content document: https://textbookfull.com/product/microsoft-sql-server-2019-a-beginners-guide-dusan-p etkovic/

Microsoft SQL Server 2019: A Beginner’s Guide Dusan Petkovic

More products digital (pdf, epub, mobi) instant download maybe you interests ...

Microsoft SQL Server 2016 a beginner's guide Sixth Edition Petkovic

https://textbookfull.com/product/microsoft-sqlserver-2016-a-beginners-guide-sixth-edition-petkovic/

Tabular modeling in Microsoft SQL Server Analysis Service Marco Russo

https://textbookfull.com/product/tabular-modeling-in-microsoftsql-server-analysis-service-marco-russo/

Professional Microsoft SQL Server 2014 Integration Services 1st Edition Brian Knight

https://textbookfull.com/product/professional-microsoft-sqlserver-2014-integration-services-1st-edition-brian-knight/

Azure SQL Revealed: A Guide to the Cloud for SQL Server Professionals Bob Ward

https://textbookfull.com/product/azure-sql-revealed-a-guide-tothe-cloud-for-sql-server-professionals-bob-ward/

Azure SQL Revealed: A Guide to the Cloud for SQL Server Professionals 1st Edition Bob Ward

https://textbookfull.com/product/azure-sql-revealed-a-guide-tothe-cloud-for-sql-server-professionals-1st-edition-bob-ward/

Murach s SQL Server 2019 for Developers 1st Edition

Joel Murach

https://textbookfull.com/product/murach-s-sql-server-2019-fordevelopers-1st-edition-joel-murach/

Query Store for SQL Server 2019 1st Edition Tracy Boggiano Grant Fritchey

https://textbookfull.com/product/query-store-for-sqlserver-2019-1st-edition-tracy-boggiano-grant-fritchey/

Building Custom Tasks for SQL Server Integration Services: The Power of .NET for ETL for SQL Server 2019 and Beyond 2nd Edition Andy Leonard

https://textbookfull.com/product/building-custom-tasks-for-sqlserver-integration-services-the-power-of-net-for-etl-for-sqlserver-2019-and-beyond-2nd-edition-andy-leonard/

Building Custom Tasks for SQL Server Integration Services The Power of NET for ETL for SQL Server 2019 and Beyond Second Edition Andy Leonard

https://textbookfull.com/product/building-custom-tasks-for-sqlserver-integration-services-the-power-of-net-for-etl-for-sqlserver-2019-and-beyond-second-edition-andy-leonard/

Copyright © 2020 by McGraw-Hill Education. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher.

ISBN: 978-1-26-045888-6

MHID: 1-26-045888-1

The material in this eBook also appears in the print version of this title: ISBN: 978-1-26-045887-9, MHID: 1-26-045887-3.

eBook conversion by codeMantra

Version 1.0

All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.

McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and sales promotions or for use in corporate training programs. To contact a representative, please visit the Contact Us page at www.mhprofessional.com.

Information has been obtained by McGraw-Hill Education from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, McGraw-Hill Education, or others, McGraw-Hill Education does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or

omissions or the results obtained from the use of such information.

TERMS OF USE

This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Education’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.

THE WORK IS PROVIDED “AS IS.” McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill Education nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill

Education has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.

About the Author

Dušan Petković is a computer science professor at the Polytechnic in Rosenheim, Germany. He is the bestselling author of the six previous editions of this book and has written numerous articles for SQL Server Magazine.

ABOUT THE TECHNICAL EDITOR

Todd Meister has been working in the IT industry for over 20 years. He’s been a technical editor on over 75 titles ranging from SQL Server to the .NET Framework. Besides technical editing books, he is the Assistant Vice President/Chief Enterprise Architect at Ball State University in Muncie, Indiana. He lives in central Indiana with his wife, Kimberly, and their five phenomenal children.

Acknowledgments

I would like to acknowledge the important contributions of my editor, Lisa McClain, my technical editor, Todd Meister, and my copy editor, Bill McManus.

at a Glance

Part I Basic Concepts and Installation 1 Relational Database Systems: An Introduction 2 Planning the Installation and Installing SQL Server 3 Front-End Tools for the Database Engine Part II Transact-SQL Language 4 SQL Components 5 Data Definition Language 6 Queries 7 Modification of a Table’s Contents 8 Stored Procedures and User-Defined Functions 9 System Catalog 10 Indices 11 Views 12 Security System of the Database Engine 13 Concurrency Control 14 Triggers
Contents
Part III SQL Server: System Administration 15 System Environment of the Database Engine 16 Backup, Recovery, and System Availability 17 Automating System Administration Tasks 18 Data Replication 19 Query Optimizer 20 Performance Tuning 21 In-Memory OLTP Part IV SQL Server and Business Intelligence 22 Business Intelligence: An Introduction 23 SQL Server Analysis Services 24 Business Intelligence and Transact-SQL 25 SQL Server Reporting Services 26 Optimizing Techniques for Data Warehousing 27 Columnstore Indices 28 Intelligent Query Processing Part V Beyond Relational Data 29 JSON Integration in the Database Engine 30 Spatial and Temporal Data

31 SQL Server Graph Databases

Part VI Machine Learning

32 SQL Server Machine Learning Services: R Support

33 SQL Server Machine Learning Services: Python Support

Appendix Exercise Solutions Index

Contents

Introduction

Part I Basic Concepts and Installation

Chapter 1 Relational Database Systems: An Introduction

Database Systems: An Overview

Variety of User Interfaces

Physical Data Independence

Logical Data Independence

Query Optimization

Data Integrity

Concurrency Control

Backup and Recovery

Database Security

Relational Database Systems

Working with the Book’s sample Database

SQL: A Relational Database Language

Database Design

Normal Forms

Entity-Relationship Model

Syntax Conventions

Summary

Exercises

Chapter 2 Planning the Installation and Installing

SQL Server

SQL Server Editions and Management Tools

SQL Server Editions

Management Tools

Planning Phase: General Recommendations

Which Operating System Will Be Used?

Which SQL Server Components Should Be Installed?

Where Will the Root Directory Be Stored?

Should Multiple Instances of the Database Engine Be Used?

Which Authentication Mode for the Database Engine Should Be Used?

Installation of SQL Server on Windows or Ubuntu

Planning the Installation on Windows

Installing SQL Server on Windows

Installing SQL Server Directly on Ubuntu

Summary

Chapter 3 Front-End Tools for the Database Engine

SQL Server Management Studio

Connecting to a Server

Registered Servers

Object Explorer

Organizing and Navigating SQL Server Management Studio’s Panes

Using SQL Server Management Studio with the Database Engine

Administering Database Servers

Managing Databases Using Object Explorer

Authoring Activities Using SQL Server Management Studio

Query Editor

Solution Explorer

Data Discovery and Classification

Azure Data Studio

Installation of Azure Data Studio

Configuration

Object Explorer

Code Editor

Database Dashboards and Customization

SQL Server Management Studio vs. Azure Data Studio

Summary

Exercises

Part II Transact-SQL Language

Chapter 4 SQL Components

SQL’s Basic Objects

Literal Values

Identifiers

Delimiters

Comments

Reserved Keywords

Data Types

Numeric Data Types

Character Data Types

Temporal Data Types

Miscellaneous Data Types

Storage Options

Transact-SQL Functions

Aggregate Functions

Scalar Functions

Scalar Operators

Global Variables

NULL Values

Summary

Exercises

Chapter 5 Data Definition Language

Creating Database Objects

Creation of a Database

CREATE TABLE: A Basic Form

CREATE TABLE and Declarative Integrity Constraints

Referential Integrity

Creating Other Database Objects

Integrity Constraints and Domains

Modifying Database Objects

Altering a Database

Altering a Table

Removing Database Objects

Summary Exercises

Chapter 6 Queries

SELECT Statement: Its Clauses and Functions

WHERE Clause

GROUP BY Clause

Aggregate Functions

HAVING Clause

ORDER BY Clause

SELECT Statement and IDENTITY Property

CREATE SEQUENCE Statement

Set Operators

CASE Expressions

Subqueries

Subqueries and Comparison Operators

Subqueries and the IN Operator

Subqueries and ANY and ALL Operators

Temporary Tables

Join Operator

Two Syntax Forms to Implement Joins

Natural Join

Cartesian Product

Outer Join

Further Forms of Join Operations

Correlated Subqueries

Subqueries and the EXISTS Function

Should You Use Joins or Subqueries?

Table Expressions

Derived Tables

Common Table Expressions

Summary Exercises

Chapter 7 Modification of a Table’s Contents

INSERT Statement

Inserting a Single Row

Inserting Multiple Rows

Table Value Constructors and INSERT

UPDATE Statement

DELETE Statement

Other T-SQL Modification Statements and Clauses

TRUNCATE TABLE Statement

MERGE Statement

The OUTPUT Clause

Summary Exercises

Chapter 8 Stored Procedures and User-Defined Functions

Procedural Extensions

Block of Statements

IF Statement WHILE Statement

Local Variables

Miscellaneous Procedural Statements

Exception Handling with TRY, CATCH, and THROW

Stored Procedures

Creation and Execution of Stored Procedures

User-Defined Functions

Types of User-Defined Functions

Creation and Execution of User-Defined Functions

Changing the Structure of UDFs

Summary

Exercises

Chapter 9 System Catalog

Introduction to the System Catalog

General Interfaces

Catalog Views

Dynamic Management Views and Functions

Information Schema

Proprietary Interfaces

System Stored Procedures

System Functions

Property Functions

Summary

Exercises

Chapter 10 Indices

Introduction to Indices

Clustered Indices

Nonclustered Indices

Transact-SQL and Indices

Creating Indices

Editing Information Concerning Indices

Altering Indices

Creation of Resumable Online Indices

Removing and Renaming Indices

Guidelines for Creating and Using Indices

Indices and Conditions in the WHERE Clause

Indices and the Join Operator

Covering Index

Missing Indices

Special Types of Indices

Summary

Exercises

Chapter 11 Views

DDL Statements and Views

Creating a View

Altering and Removing Views

DML Statements and Views

View Retrieval

INSERT Statement and a View

UPDATE Statement and a View

DELETE Statement and a View

Editing Information Concerning Views

Summary

Exercises

Chapter 12 Security System of the Database Engine

Encrypting Data

Symmetric Keys

Asymmetric Keys

Certificates

Editing Metadata Concerning User Keys

Extensible Key Management

Methods of Data Encryption

Authentication

Setting Up the Database System Security

Schemas

User–Schema Separation

DDL Schema-Related Statements

Default Database Schemas

Database Security

Managing Database Security Using SQL Server Management Studio

Managing Database Security Using Transact-SQL Statements

Roles

Fixed Server Roles

Fixed Database Roles

Application Roles

User-Defined Server Roles

User-Defined Database Roles

Authorization

GRANT Statement

DENY Statement

REVOKE Statement

Managing Permissions Using SQL Server Management Studio

Managing Authorization and Authentication of Contained

Databases

Change Tracking

Data Security and Views

Summary

Exercises

Chapter 13 Concurrency Control

Concurrency Models

Transactions

Properties of Transactions

Transact-SQL Statements and Transactions

Transaction Log

Editing Information Concerning Transactions and Logs

Locking

Lock Modes

Lock Granularity

Lock Escalation

Affecting Locks

Displaying Lock Information

Deadlock

Isolation Levels

Concurrency Problems

The Database Engine and Isolation Levels

Row Versioning

Read Committed Snapshot Isolation

Snapshot Isolation

Summary

Exercises

Chapter 14 Triggers

Introduction to Triggers

Creating a DML Trigger

Modifying a Trigger’s Structure

Using deleted and inserted Virtual Tables

Application Areas for DML Triggers

AFTER Triggers

INSTEAD OF Triggers

First and Last Triggers

DDL Triggers and Their Application Areas

Database-Level Triggers

Server-Level Triggers

Summary

Exercises

Part III SQL Server: System Administration

15 System Environment of the Database Engine

System Databases

master Database

model Database

tempdb Database

msdb Database

Disk Storage

Properties of Data Pages

Types of Data Pages

Editing Information Concerning Disk Storage

Parallel Processing of Tasks

Utilities

bcp Utility

sqlcmd Utility

mssql-cli Utility

sqlservr Utility

DBCC Commands

Validation Commands

Performance Command

Policy-Based Management

Key Terms and Concepts

Using Policy-Based Management

Summary

Exercises

Chapter 16 Backup, Recovery, and System

Availability

Reasons for Data Loss

Introduction to Backup Methods

Full Database Backup

Differential Backup

Transaction Log Backup

File or Filegroup Backup

Performing Database Backup

Backing Up Using Transact-SQL Statements

Backing Up Using SQL Server Management Studio

Determining Which Databases to Back Up

Performing Database Recovery

Automatic Recovery

Manual Recovery

Recovery Models

System Availability

Using a Standby Server

Using RAID Technology

Database Mirroring

Failover Clustering

Log Shipping

AlwaysOn

Comparison of High-Availability Components

Maintenance Plan Wizard

Summary Exercises

Chapter 17 Automating System Administration Tasks

Starting SQL Server Agent

Creating Jobs and Operators

Creating a Job and Its Steps

Creating a Job Schedule

Notifying Operators About the Job Status

Viewing the Job History Log

Alerts

Error Messages

SQL Server Agent Error Log

Windows Application Log

Defining Alerts to Handle Errors

Summary Exercises

Chapter 18 Data Replication

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.