Preface |
|
ix | |
|
Module 1 Introduction to KimTay Pet Supplies and StayWell Student |
|
|
|
|
1 | (1) |
|
|
1 | (1) |
|
|
1 | (1) |
|
The KimTay Pet Supplies Database |
|
|
2 | (6) |
|
StayWell Student Accommodation Database |
|
|
8 | (4) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
12 | (3) |
|
|
12 | (1) |
|
StayWell Student Accommodation |
|
|
13 | (2) |
|
Module 2 Database Design Fundamentals |
|
|
15 | (36) |
|
|
15 | (1) |
|
|
16 | (4) |
|
|
16 | (1) |
|
Entities, Attributes, and Relationships |
|
|
17 | (3) |
|
|
20 | (3) |
|
|
23 | (2) |
|
|
25 | (8) |
|
|
25 | (1) |
|
Database Design Requirements |
|
|
26 | (1) |
|
Database Design Process Example |
|
|
27 | (6) |
|
|
33 | (10) |
|
|
33 | (2) |
|
|
35 | (3) |
|
|
38 | (5) |
|
Diagrams for Database Design |
|
|
43 | (2) |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
47 | (4) |
|
|
47 | (1) |
|
StayWell Student Accommodation |
|
|
48 | (3) |
|
|
51 | (46) |
|
|
51 | (1) |
|
Creating and Running SQL Commands |
|
|
52 | (5) |
|
|
52 | (2) |
|
|
54 | (3) |
|
|
57 | (3) |
|
Changing the Default Database |
|
|
59 | (1) |
|
|
60 | (7) |
|
Correcting Errors in SQL Commands |
|
|
65 | (1) |
|
|
66 | (1) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
69 | (5) |
|
|
69 | (4) |
|
Inserting a Row that Contains Nulls |
|
|
73 | (1) |
|
|
74 | (2) |
|
Correcting Errors in a Table |
|
|
76 | (3) |
|
|
79 | (4) |
|
Creating the Remaining Database Tables |
|
|
83 | (5) |
|
|
88 | (4) |
|
|
92 | (1) |
|
|
92 | (1) |
|
|
92 | (1) |
|
|
93 | (4) |
|
|
94 | (1) |
|
StayWell Student Accommodation |
|
|
94 | (3) |
|
Module 4 Single-Table Queries |
|
|
97 | (38) |
|
|
97 | (1) |
|
Constructing Simple Queries |
|
|
97 | (14) |
|
Retrieving Certain Columns and All Rows |
|
|
98 | (1) |
|
Retrieving All Columns and All Rows |
|
|
99 | (1) |
|
|
100 | (2) |
|
Using Compound Conditions |
|
|
102 | (3) |
|
Using the BETWEEN Operator |
|
|
105 | (2) |
|
|
107 | (2) |
|
|
109 | (2) |
|
|
111 | (1) |
|
|
111 | (2) |
|
Using the ORDER BY Clause |
|
|
112 | (1) |
|
Additional Sorting Options |
|
|
112 | (1) |
|
|
113 | (6) |
|
|
114 | (1) |
|
|
115 | (1) |
|
Using the AVG, MAX, and MIN Functions |
|
|
115 | (2) |
|
Using the DISTINCT Operator |
|
|
117 | (2) |
|
|
119 | (4) |
|
|
121 | (2) |
|
|
123 | (5) |
|
Using the GROUP BY Clause |
|
|
124 | (1) |
|
|
125 | (1) |
|
|
126 | (2) |
|
|
128 | (1) |
|
Summary of SQL Clauses, Functions, and Operators |
|
|
129 | (1) |
|
|
130 | (1) |
|
|
131 | (1) |
|
|
131 | (1) |
|
|
132 | (3) |
|
|
132 | (1) |
|
StayWell Student Accommodation |
|
|
133 | (2) |
|
Module 5 Multiple-Table Queries |
|
|
135 | (38) |
|
|
135 | (1) |
|
|
135 | (4) |
|
|
135 | (4) |
|
Comparing Joins, IN, and EXISTS |
|
|
139 | (14) |
|
|
139 | (1) |
|
Using the EXISTS Operator |
|
|
140 | (2) |
|
Using a Subquery Within a Subquery |
|
|
142 | (2) |
|
|
144 | (1) |
|
|
145 | (1) |
|
Joining a Table to Itself |
|
|
146 | (2) |
|
Using a Self-Join on a Primary Key Column |
|
|
148 | (2) |
|
|
150 | (3) |
|
|
153 | (6) |
|
|
159 | (3) |
|
|
162 | (5) |
|
|
162 | (1) |
|
|
163 | (2) |
|
|
165 | (2) |
|
|
167 | (1) |
|
|
168 | (1) |
|
|
168 | (1) |
|
|
169 | (4) |
|
|
169 | (1) |
|
StayWell Student Accommodation |
|
|
170 | (3) |
|
|
173 | (28) |
|
|
173 | (1) |
|
Creating a New Table from an Existing Table |
|
|
173 | (3) |
|
Changing Existing Data in a Table |
|
|
176 | (3) |
|
Adding New Rows to an Existing Table |
|
|
179 | (1) |
|
Autocommit, Commit, and Rollback |
|
|
180 | (3) |
|
|
183 | (1) |
|
Changing and Deleting Existing Rows |
|
|
184 | (3) |
|
|
186 | (1) |
|
Changing a Value in a Column to Null |
|
|
187 | (2) |
|
Changing a Table's Structure |
|
|
189 | (7) |
|
|
196 | (1) |
|
|
196 | (1) |
|
|
197 | (1) |
|
|
197 | (1) |
|
|
197 | (1) |
|
|
198 | (3) |
|
|
198 | (1) |
|
StayWell Student Accommodation |
|
|
199 | (2) |
|
Module 7 Database Administration |
|
|
201 | (38) |
|
|
201 | (1) |
|
|
201 | (9) |
|
Using a View to Update Data |
|
|
210 | (6) |
|
Updating Row-and-Column Subset Views |
|
|
210 | (2) |
|
Updating Views Involving Joins |
|
|
212 | (4) |
|
Updating Views Involving Statistics |
|
|
216 | (1) |
|
|
216 | (1) |
|
|
217 | (2) |
|
|
219 | (6) |
|
|
222 | (1) |
|
|
223 | (2) |
|
|
225 | (1) |
|
|
225 | (4) |
|
Update of the System Catalog |
|
|
228 | (1) |
|
Integrity Constraints in SQL |
|
|
229 | (4) |
|
|
233 | (1) |
|
|
233 | (1) |
|
|
234 | (1) |
|
|
235 | (4) |
|
|
235 | (2) |
|
StayWell Student Accommodation |
|
|
237 | (2) |
|
Module 8 Functions, Procedures, and Triggers |
|
|
239 | (1) |
|
|
239 | (1) |
|
Using SQL in a Programming Environment |
|
|
239 | (1) |
|
|
240 | (8) |
|
|
241 | (1) |
|
|
242 | (1) |
|
|
243 | (5) |
|
|
248 | (4) |
|
Stored Procedures Using MySQL |
|
|
252 | (3) |
|
Retrieving a Single Row and Column |
|
|
253 | (2) |
|
|
255 | (4) |
|
|
259 | (3) |
|
Changing Data with a Procedure |
|
|
259 | (1) |
|
Deleting Data with a Procedure |
|
|
260 | (2) |
|
Selecting Multiple Rows with a Procedure |
|
|
262 | (6) |
|
|
262 | (1) |
|
|
263 | (1) |
|
Fetching Rows from a Cursor |
|
|
263 | (2) |
|
|
265 | (1) |
|
Writing a Complete Procedure Using a Cursor |
|
|
265 | (1) |
|
Using More Complex Cursors |
|
|
265 | (3) |
|
|
268 | (1) |
|
|
268 | (4) |
|
|
270 | (1) |
|
Writing a Complete Procedure Using a Cursor in PL/SQL |
|
|
271 | (1) |
|
Using T-SQL in SQL Server |
|
|
272 | (3) |
|
Retrieving a Single Row and Column in T-SQL |
|
|
272 | (1) |
|
Changing Data with a Stored Procedure in T-SQL |
|
|
273 | (1) |
|
Deleting Data with a Stored Procedure in T-SQL |
|
|
273 | (1) |
|
|
274 | (1) |
|
Using More Complex Cursors in T-SQL |
|
|
275 | (1) |
|
|
275 | (7) |
|
|
282 | (1) |
|
|
283 | (1) |
|
|
283 | (1) |
|
|
284 | (1) |
|
|
284 | (2) |
|
StayWell Student Accommodation |
|
|
286 | |
|
|
1 | (14) |
|
|
1 | (1) |
|
|
1 | (1) |
|
Column or Expression List (SELECT Clause) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
3 | (3) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
13 | (1) |
|
Union, Intersect, And Minus |
|
|
13 | (1) |
|
|
14 | (1) |
|
Appendix B How Do I Reference |
|
|
15 | (4) |
|
Appendix C The 10 Commandments of Writing Queries |
|
|
19 | |
Index |
|
1 | |