Any time the defined
operation (a book INSERT) happens, the code will execute (in our case, after the
insertion). Therefore, we just have to insert a new book to see the author.total_
page_count column be updated.
Of course, a completely automatic management of this column would involve
creating AFTER UPDATE and AFTER DELETE triggers on the book table.
Information_schema
In the SQL:2003 standard, access to the data dictionary (or database metadata) is
provided by a structure called information_schema. Beacause this is part of the
standard and already exists in other database systems, the decision to implement this
feature into MySQL was a very good one.
MySQL has added some information that is not part of the standard, for
example INFORMATION_SCHEMA.COLUMNS.COLUMN_TYPE. Beware of
that fact if you plan to use this information in a software project that has
to remain portable to other SQL implementations.
MySQL 5.0 Features
[ 278 ]
A phpMyAdmin user sees information_schema as a normal database containing
views that describe many aspects of the structure of the databases hosted on this
server. Here is a subset of what can be seen (and in fact, the only possible operation
on this database is SELECT).
Internally, phpMyAdmin calls information_schema for some of its operations,
instead of the corresponding SHOW statements to retrieve metadata.
Pages:
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255