Professional Documents
Culture Documents
Microsoft SQL Server 2016 A Beginners Guide Sixth Edition Petkovic Full Chapter
Microsoft SQL Server 2016 A Beginners Guide Sixth Edition Petkovic Full Chapter
Microsoft SQL Server 2016 A Beginners Guide Sixth Edition Petkovic Full Chapter
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Contents at a Glance
||||||||||||||||||||
||||||||||||||||||||
Index
||||||||||||||||||||
||||||||||||||||||||
Contents
Introduction
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
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
||||||||||||||||||||
||||||||||||||||||||
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
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Stored Procedures
Creation and Execution of Stored Procedures
Stored Procedures and CLR
User-Defined Functions
Creation and Execution of User-Defined Functions
Changing the Structure of UDFs
User-Defined Functions and CLR
Summary
Exercises
Chapter 10 Indices
Introduction
Clustered Indices
Nonclustered Indices
Transact-SQL and Indices
Creating Indices
||||||||||||||||||||
||||||||||||||||||||
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
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Exercises
Chapter 14 Triggers
Introduction
Creating a DML Trigger
Modifying a Trigger’s Structure
Using deleted and inserted Virtual Tables
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Summary
Exercises
||||||||||||||||||||
||||||||||||||||||||
Setting Up Publications
Configuring Subscription Servers
Summary
Exercises
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Summary
Exercises
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
XML-Related Languages
Schema Languages
Document Type Definition
XML Schema
Storing XML Documents in the Database Engine
Storing XML Documents Using the XML Data Type
Storing XML Documents Using Decomposition
Presenting and Querying XML Documents
Presenting XML Documents as Relational Data
Presenting Relational Data as XML Documents
Querying XML Documents
JSON: An Introduction
XML vs. JSON
Why Support JSON in SQL?
Storing JSON Documents in the Database Engine
Presenting and Querying JSON Documents
Presenting JSON Documents as Relational Data
Presenting Relational Data as JSON Documents
Querying JSON Documents
Summary
||||||||||||||||||||
||||||||||||||||||||
Technet24
||||||||||||||||||||
||||||||||||||||||||
Index
||||||||||||||||||||
||||||||||||||||||||
Technet24
||||||||||||||||||||
||||||||||||||||||||
Introduction
T here are a couple of reasons why SQL Server, the system that comprises the
Database Engine, Analysis Services, Reporting Services, and Integration
Services, is the best choice for a broad spectrum of end users and database
programmers building business applications:
SQL Server is certainly the best system for Windows operating systems, because
of its tight integration (and low pricing). Because the number of installed
Windows systems is enormous and still increasing, SQL Server is a widely used
database system.
The Database Engine, as the relational database system component, is the easiest
database system to use. In addition to the well-known user interface, Microsoft
offers several different tools to help you create database objects, tune your
database applications, and manage system administration tasks.
Generally, SQL Server isn’t only a relational database system. It is a platform that
not only manages structured, semistructured, and unstructured data but also offers
comprehensive, integrated operational and analysis software that enables organizations
to reliably manage mission-critical information.
||||||||||||||||||||
||||||||||||||||||||
Technet24
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Technet24
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Part III, “SQL Server: System Administration,” describes all objectives of Database
Engine system administration. It comprises the following chapters:
Technet24
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Chapter 28, “XML and JSON Integration in the Database Engine,” discusses first
XML integration in the Database Engine and Microsoft’s set of data types and
functions that supports XML in the Database Engine, bridging the gap between
XML and relational data. The beginning of the chapter introduces the
standardized data type called XML and explains how stored XML documents can
be retrieved. After that, the presentation of relational data as XML documents is
discussed in detail. The second part of the chapter explains the support of another
data format called JSON. The structure of this part is identical to the one
describing the XML integration.
Chapter 29, “Spatial and Temporal Data,” discusses two special data forms:
spatial data and temporal data. First, the spatial data types, GEOMETRY and
GEOGRAPHY, are described. Several different standardized functions in
relation to spatial data are shown. The second part of the chapter explains
temporal data. It introduces temporal tables, which are used to store temporal
data, and explains some special properties of temporal data.
Chapter 30, “SQL Server Full-Text Search,” first discusses general concepts
related to full-text search. The second part describes the general steps that are
required to create a full-text index and then demonstrates how to apply those
steps first using Transact-SQL and then using SQL Server Management Studio.
The rest of the chapter is dedicated to full-text queries. It describes two
predicates and two row functions that can be used for full-text search. For these
predicates and functions, several examples are provided to show how you can
solve specific problems in relation to extended operations on documents.
Almost all chapters include at their end numerous exercises that you can use to
improve your knowledge concerning the chapter’s content. All solutions to the given
exercises can be found at my own home page (www.fh-rosenheim.de/~petkovic).
Technet24
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Whereas the semicolon (;) is used in SQL to separate two SQL statements in a
statement group (and you will generally get an error message if you do not
include the semicolon), in Transact-SQL, use of semicolons is strongly
recommended but can be omitted.
Transact-SQL uses the GO statement. This nonstandardized statement is generally
used to separate statement groups from each other, whereas some Transact-SQL
statements (such as CREATE TABLE, CREATE INDEX, and so on) must be the
only statement in the group.
Technet24
||||||||||||||||||||
||||||||||||||||||||
The USE statement, which is used very often in this book, changes the database
context to the specified database. For example, the statement USE sample means
that the statements that follow will be executed in the context of the sample
database.
||||||||||||||||||||
||||||||||||||||||||
You can download the sample database from my own home page (www.fh-
rosenheim.de/~petkovic). Also, you can download all the examples in the book as well
as solutions for exercises from my home page.
Although the sample database can be used for many of the examples in this book, for
some examples, tables with a lot of rows are necessary (to show optimization features,
for instance). For this reason, two Microsoft sample databases—AdventureWorks and
AdventureWorksDW—are also used. Both of them can be downloaded from the
Microsoft CodePlex web site.
Acknowledgments
Technet24
||||||||||||||||||||
||||||||||||||||||||
||||||||||||||||||||
Another random document with
no related content on Scribd:
It might be said that the southern United States furnish an extreme
case of a sharply drawn color-line. This is true. But on the other hand
there is no place on earth where something corresponding to a color-
line is not drawn between two races occupying the same territory. It
sometimes happens that distinctions are diminished and faintly or
subtly enforced, as in modern Hawaii, where to outward
appearances many races dwell together without discrimination. Yet
examination reveals that the absence of discrimination is only legal
and perhaps economic. As regards the relations and associations of
human beings, the welcome which they extend or the aloofness
which they show to one another, there is always a color-line. This
means not only difference in opportunity, but difference in
experience, habit formation, practices, and interests.
It must be borne in mind that the two groups were not set apart as
the result of tests, but that the two tests were devised to meet the
problem of treating the two groups with reasonable uniformity. The
point was to find the excellent man, and the unfit man, with the same
degree of accuracy whether he was literate or illiterate. When found,
he was assigned to the same grade, such as A, or D—, whether his
examination had been Alpha or Beta.
Now let us observe some of the figures. The New York negro is
nearly on a par with the Alabama white, among literates, and a bit
ahead of him among illiterates. Approximately the two groups come
out the same; which means that bringing up in a certain part of the
country has as much to do with intelligence, even in the rough, as
has Caucasian or colored parentage.
The literate negroes of the draft, irrespective of section, slightly
surpass the illiterate whites.
In every case the literate members of a race or nationality make a
far better showing than the illiterate.
It is now clear also that the important factor of education enters so
heavily into the first figures cited that they can mean little if anything
as to inherent capacity. Of the Englishmen tested, nine-tenths fell in
the literate group; of the Poles, a fifth; of the Italians, a seventh. In
the draft generally, nearly three-fourths of the whites were literate; of
the negroes, less than a third.
In short, in spite of the fact that the Beta test was intended to
equalize conditions for the illiterate and semi-illiterate, the
outstanding conclusion of the army examinations seems to be that
education—cultural advantage—enormously develops faculty.
Is there anything left that can positively be assigned to race
causation? It may be alleged that within the same section the white
recruits regularly surpass the colored. Alabama whites may rate
disappointingly, but they do better than Alabama negroes; New York
negroes show surprisingly well, but they are inferior to New York
whites; illiterate whites from the whole country definitely surpass
illiterate negroes; and still more so among literates. But is this
residuum of difference surely racial? As long as the color-line
remains drawn, a differential factor of cultural advantage is included;
and how strong this is there is no present means of knowing. It is
possible that some of the difference between sectionally and
educationally equalized groups of whites and negroes is really innate
and racial. But it is also possible that most or all of it is
environmental. Neither possibility can be demonstrated from the
unrefined data at present available.
46. Summary
It would seem that the subject of race problems, that is, the natural
endowment of human races, can be summarized as follows:
The essential difficulty of these problems lies in the fact that the
performance of groups is the product of two sets of factors, biological
and cultural, both of which are variable and not always readily
separable.
Progress in solution of the problems will be made gradually, and
will be hastened by recognition of how few positive determinations
have been made.
Most of the alleged existing evidence on race endowment is likely
to be worthless.
The remainder probably has some value, but to what degree, and
what it demonstrates, cannot yet be asserted.
The most definite determinations promise to eventuate from
experiment. If fully controlled experiments in breeding and rearing
human beings could be carried out, the problems would soon begin
to solve. Experiments on animals would prove practically nothing
because animals are cultureless—uninfluenced by social
environment of their own making.
Progress will be aided by increasing shift of attention from the
crude consideration of comparative lump rating of the races, that is,
their gross superiority or inferiority, to a consideration of such
specific qualitative differences as they may prove to show. The
question of finding the race in which the greatest number of
qualitative excellences are concentrated is subsequent and of much
less scientific importance.
Scientific inquiries into race are for the present best kept apart
from so-called actual race problems. These problems inevitably
involve feeling, usually of considerable strength, which tends to
vitiate objective approach. On the other hand, the practical problems
will no doubt continue to be met practically, that is, morally and
emotionally. Whether the Japanese should be forbidden to hold land
and the Negro be legally disfranchised are problems of economics
and of group ethics, which probably will for a long time be disposed
of emotionally as at present, irrespective of the possible findings of
science upon the innate endowment of Caucasian, Mongoloid, and
Negroid strains.
CHAPTER V
LANGUAGE