MariaDB Crash Course - Ben Forta [97]
with MySQL Workbench, 261-262
customers, 257
default values, 181-182
deleting, 185
deleting data from, 171-172
explained, 6-7
foreign keys, 124
fully qualified table names, 34-35
functions of, 255
inserting retrieved data, 166-168
joins
advantages of, 125
with aggregate functions, 139-140
creating, 125-129
explained, 123
inner joins, 129-130
join conditions, 140
joining multiple tables, 130-132
natural joins, 136-137
outer joins, 137-138
self joins, 134-136
naming, 7
NULL values, 50, 177-178
orderitems, 258
orders, 257-258
overwriting, 177
performance considerations, 131
primary keys, 124, 179-180
productnotes, 259
products, 256-257
relational tables, 123-124
renaming, 185
replacing, 177
rows
explained, 8
inserting multiple rows, 165-166
inserting single rows, 161-164
NULL, 8
retrieving, 31-32
updating, 169-171, 183-185
vendors, 256
viewing list of, 23
virtual. See views
Tan() function, 96
terminating statements, 28
text functions, 90-92
text searches. See full-text searching
time functions, 92-95
TINYINT datatype, 266
transaction processing
COMMIT statement, 228-229
default commit behavior, 230
explained, 225-226
explicit commits, 228-229
implicit commits, 228
managing, 227
ROLLBACK statement, 227-228
SAVEPOINT statement, 229
savepoints, 229-230
support for, 225
terminology, 227
transactions, 227
triggers
creating, 218
DELETE, 221-222
dropping, 219
explained, 217
INSERT, 219-221
tips and guidelines, 223-224
UPDATE, 223
Trim() function, 84
trimming padded spaces, 83-84
TRUNCATE TABLE statement, 172
U
underscore (_) wildcard, 64
UNION keyword, 142-145
unions. See combined queries
UPDATE statement, 169-171
guidelines, 172-173
subqueries, 170
UPDATE triggers, 223
updating data, 172-173
tables, 169-171, 183-185
views, 194
Upper() function, 91
USE statement, 22
user accounts
access rights, 238-241
creating, 237-238
deleting, 238
obtaining list of, 236-237
passwords, 241-242
utilities. See specific utilities
V
VARBINARY datatype, 264, 267
variable-length strings, 264
vendors table, 256
verbose option (mysqld), 245
version option (mysqld), 245
viewing
available databases, 23
available tables, 23
columns, 24
views
advantages of, 188
calculated fields, 193-194
creating, 189
explained, 187
filtering data, 192
performance concerns, 188
reformatting retrieved data, 191
reusable views, 190
rules and restrictions, 188-189
simplifying joins with, 189-190
updating, 194
virtual tables. See views
W-X-Y-Z
WHERE clause, 45-46, 109-110, 145
checking against single value, 47
checking for nonmatches, 48-49
checking for NULL value, 50-51
checking for range of values, 49-50
combined queries, 141
combining clauses
AND operator, 53-54
OR operator, 54-55
order of evaluation, 55-56
conditional operators, 46
DELETE statements, 171
IN operator, 57-58
joins, 129
NOT operator, 58-59
parentheses and, 56
subqueries, 118
UPDATE statements, 169-170
wildcards, 61
white space in SQL statements, 29
whitespace metacharacters, 74
Widenius, Michael, 14
wildcard filtering
LIKE operator, 61
% (percent sign) wildcard, 62-63
tips, 65
_ (underscore) wildcard, 64
wildcards, 30, 61
writing stored procedures, 198
zip codes, 265