Preface |
|
xi | |
|
Chapter 1 SQL Crash Course |
|
|
1 | (12) |
|
|
1 | (5) |
|
|
1 | (1) |
|
|
2 | (1) |
|
Database Management Systems (DBMS) |
|
|
3 | (3) |
|
|
6 | (4) |
|
|
7 | (2) |
|
|
9 | (1) |
|
|
10 | (3) |
|
Chapter 2 Where Can I Write SQL Code? |
|
|
13 | (24) |
|
|
14 | (6) |
|
|
15 | (2) |
|
|
17 | (1) |
|
|
17 | (1) |
|
|
18 | (1) |
|
|
19 | (1) |
|
|
20 | (4) |
|
Connect a Database Tool to a Database |
|
|
22 | (2) |
|
Other Programming Languages |
|
|
24 | (13) |
|
Connect Python to a Database |
|
|
25 | (6) |
|
|
31 | (6) |
|
Chapter 3 The SQL Language |
|
|
37 | (16) |
|
Comparison to Other Languages |
|
|
37 | (2) |
|
|
39 | (2) |
|
|
41 | (9) |
|
|
42 | (1) |
|
|
43 | (2) |
|
|
45 | (2) |
|
Expressions and Predicates |
|
|
47 | (1) |
|
Comments, Quotes, and Whitespace |
|
|
48 | (2) |
|
|
50 | (3) |
|
Chapter 4 Querying Basics |
|
|
53 | (38) |
|
|
55 | (8) |
|
|
57 | (2) |
|
|
59 | (2) |
|
|
61 | (2) |
|
|
63 | (6) |
|
|
66 | (1) |
|
|
66 | (3) |
|
|
69 | (4) |
|
|
73 | (5) |
|
|
75 | (3) |
|
|
78 | (5) |
|
|
83 | (2) |
|
|
85 | (3) |
|
|
88 | (3) |
|
Chapter 5 Creating, Updating, and Deleting |
|
|
91 | (52) |
|
|
91 | (6) |
|
Display Names of Existing Databases |
|
|
93 | (1) |
|
Display Name of Current Database |
|
|
94 | (1) |
|
Switch to Another Database |
|
|
95 | (1) |
|
|
95 | (1) |
|
|
96 | (1) |
|
|
97 | (18) |
|
|
98 | (2) |
|
Display Names of Existing Tables |
|
|
100 | (1) |
|
Create a Table That Does Not Already Exist |
|
|
100 | (1) |
|
Create a Table with Constraints |
|
|
101 | (4) |
|
Create a Table with Primary and Foreign Keys |
|
|
105 | (3) |
|
Create a Table with an Automatically Generated Field |
|
|
108 | (2) |
|
Insert the Results of a Query into a Table |
|
|
110 | (2) |
|
Insert Data from a Text File into a Table |
|
|
112 | (3) |
|
|
115 | (14) |
|
|
115 | (2) |
|
Display, Add, and Delete Columns |
|
|
117 | (2) |
|
Display, Add, and Delete Rows |
|
|
119 | (1) |
|
Display, Add, Modify, and Delete Constraints |
|
|
120 | (4) |
|
|
124 | (1) |
|
|
125 | (1) |
|
Update Rows of Data with the Results of a Query |
|
|
126 | (2) |
|
|
128 | (1) |
|
|
129 | (4) |
|
Create an Index to Speed Up Queries |
|
|
131 | (2) |
|
|
133 | (5) |
|
Create a View to Save the Results of a Query |
|
|
135 | (3) |
|
|
138 | (5) |
|
Double-Check Changes Before a COMMIT |
|
|
139 | (2) |
|
Undo Changes with a ROLLBACK |
|
|
141 | (2) |
|
|
143 | (36) |
|
How to Choose a Data Type |
|
|
145 | (2) |
|
|
147 | (7) |
|
|
147 | (1) |
|
|
148 | (2) |
|
|
150 | (1) |
|
Floating Point Data Types |
|
|
151 | (3) |
|
|
154 | (7) |
|
|
154 | (2) |
|
|
156 | (3) |
|
|
159 | (2) |
|
|
161 | (11) |
|
|
161 | (4) |
|
|
165 | (7) |
|
|
172 | (7) |
|
|
172 | (1) |
|
External Files (Images, Documents, etc.) |
|
|
173 | (6) |
|
Chapter 7 Operators and Functions |
|
|
179 | (58) |
|
|
180 | (11) |
|
|
181 | (1) |
|
|
182 | (7) |
|
|
189 | (2) |
|
|
191 | (2) |
|
|
193 | (6) |
|
|
194 | (2) |
|
|
196 | (1) |
|
Round and Truncate Numbers |
|
|
197 | (1) |
|
Convert Data to a Numeric Data Type |
|
|
198 | (1) |
|
|
199 | (19) |
|
Find the Length of a String |
|
|
199 | (1) |
|
Change the Case of a String |
|
|
200 | (1) |
|
Trim Unwanted Characters Around a String |
|
|
201 | (2) |
|
|
203 | (1) |
|
Search for Text in a String |
|
|
203 | (3) |
|
Extract a Portion of a String |
|
|
206 | (1) |
|
|
207 | (1) |
|
Delete Text from a String |
|
|
208 | (1) |
|
|
209 | (8) |
|
Convert Data to a String Data Type |
|
|
217 | (1) |
|
|
218 | (17) |
|
Return the Current Date or Time |
|
|
218 | (2) |
|
Add or Subtract a Date or Time Interval |
|
|
220 | (1) |
|
Find the Difference Between Two Dates or Times |
|
|
221 | (5) |
|
Extract a Part of a Date or Time |
|
|
226 | (2) |
|
Determine the Day of the Week of a Date |
|
|
228 | (1) |
|
Round a Date to the Nearest Time Unit |
|
|
229 | (1) |
|
Convert a String to a Datetime Data Type |
|
|
230 | (5) |
|
|
235 | (2) |
|
Return an Alternative Value if There Is a Null Value |
|
|
235 | (2) |
|
Chapter 8 Advanced Querying Concepts |
|
|
237 | (32) |
|
|
238 | (4) |
|
Display Values Based on If-Then Logic for a Single Column |
|
|
239 | (1) |
|
Display Values Based on If-Then Logic for Multiple Columns |
|
|
240 | (2) |
|
|
242 | (8) |
|
|
242 | (3) |
|
Aggregate Rows into a Single Value or List |
|
|
245 | (2) |
|
Rollup, Cube, and Grouping Sets |
|
|
247 | (3) |
|
|
250 | (13) |
|
|
252 | (3) |
|
Return the First Value in Each Group |
|
|
255 | (1) |
|
Return the Second Value in Each Group |
|
|
256 | (1) |
|
Return the First Two Values in Each Group |
|
|
257 | (1) |
|
Return the Prior Row Value |
|
|
258 | (1) |
|
Calculate the Moving Average |
|
|
259 | (2) |
|
Calculate the Running Total |
|
|
261 | (2) |
|
|
263 | (6) |
|
Break Up the Values of a Column into Multiple Columns |
|
|
263 | (2) |
|
List the Values of Multiple Columns in a Single Column |
|
|
265 | (4) |
|
Chapter 9 Working with Multiple Tables and Queries |
|
|
269 | (34) |
|
|
270 | (14) |
|
Join Basics and Inner Join |
|
|
274 | (3) |
|
Left Join, Right Join, and Full Outer Join |
|
|
277 | (2) |
|
|
279 | (2) |
|
|
281 | (3) |
|
|
284 | (7) |
|
|
285 | (4) |
|
|
289 | (2) |
|
|
291 | (12) |
|
|
293 | (2) |
|
|
295 | (8) |
|
|
303 | (14) |
|
Find the Rows Containing Duplicate Values |
|
|
303 | (3) |
|
Select Rows with the Max Value for Another Column |
|
|
306 | (2) |
|
Concatenate Text from Multiple Fields into a Single Field |
|
|
308 | (3) |
|
Find All Tables Containing a Specific Column Name |
|
|
311 | (2) |
|
Update a Table Where the ID Matches Another Table |
|
|
313 | (4) |
Index |
|
317 | |