Page 12 - SQL
P. 12
Chapter 38: MERGE 123
Introduction 123
Examples 123
MERGE to make Target match Source 123
MySQL: counting users by name 123
PostgreSQL: counting users by name 124
Chapter 39: NULL 125
Introduction 125
Examples 125
Filtering for NULL in queries 125
Nullable columns in tables 125
Updating fields to NULL 126
Inserting rows with NULL fields 126
Chapter 40: ORDER BY 127
Examples 127
Use ORDER BY with TOP to return the top x rows based on a column's value 127
Sorting by multiple columns 128
Sorting by column number (instead of name) 128
Order by Alias 129
Customizeed sorting order 129
Chapter 41: Order of Execution 131
Examples 131
Logical Order of Query Processing in SQL 131
Chapter 42: Primary Keys 133
Syntax 133
Examples 133
Creating a Primary Key 133
Using Auto Increment 133
Chapter 43: Relational Algebra 135
Examples 135
Overview 135
SELECT 135

