0% found this document useful (0 votes)
25K views1 page

Hihahi

This document discusses topics related to querying data in Microsoft SQL Server 2019 including: Transact-SQL functions like aggregate and scalar functions; clauses in the SELECT statement like WHERE, GROUP BY, HAVING, and ORDER BY; subqueries; temporary tables; join operations; and other related concepts. It provides an overview of these essential querying topics and techniques for beginners to learn SQL.
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)
25K views1 page

Hihahi

This document discusses topics related to querying data in Microsoft SQL Server 2019 including: Transact-SQL functions like aggregate and scalar functions; clauses in the SELECT statement like WHERE, GROUP BY, HAVING, and ORDER BY; subqueries; temporary tables; join operations; and other related concepts. It provides an overview of these essential querying topics and techniques for beginners to learn SQL.
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
You are on page 1/ 1

viii Microsoft SQL Server 2019: A Beginner’s Guide

Transact-SQL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74


Aggregate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74
Scalar Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
Scalar Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
NULL Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
Chapter 5 Data Definition Language. . . . . . . . . . . . . . . . . . . . . . . . . . . .87
Creating Database Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . .87
Creation of a Database. . . . . . . . . . . . . . . . . . . . . . . . . . . .88
CREATE TABLE: A Basic Form . . . . . . . . . . . . . . . . . . . . . .91
CREATE TABLE and Declarative Integrity Constraints . . . . . . . .93
Referential Integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
Creating Other Database Objects . . . . . . . . . . . . . . . . . . . . 101
Integrity Constraints and Domains . . . . . . . . . . . . . . . . . . . 102
Modifying Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Altering a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Altering a Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Removing Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Chapter 6 Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
SELECT Statement: Its Clauses and Functions . . . . . . . . . . . . . . . . 115
WHERE Clause. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
GROUP BY Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Aggregate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
HAVING Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
ORDER BY Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
SELECT Statement and IDENTITY Property . . . . . . . . . . . . . 139
CREATE SEQUENCE Statement . . . . . . . . . . . . . . . . . . . . 140
Set Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
CASE Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Subqueries and Comparison Operators . . . . . . . . . . . . . . . . . 149
Subqueries and the IN Operator . . . . . . . . . . . . . . . . . . . . . 150
Subqueries and ANY and ALL Operators. . . . . . . . . . . . . . . . 151
Temporary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Join Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Two Syntax Forms to Implement Joins . . . . . . . . . . . . . . . . . 154
Natural Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Cartesian Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Outer Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Further Forms of Join Operations . . . . . . . . . . . . . . . . . . . . 162

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy