IPT home IPT A Virtual Approach by Peter Whitehouse
Quick Links:
SQL home
Information and Intelligent Systems Social and Ethical Implications Human Computer Interaction Software and Systems Engineering eXercise Files Course Outline and Assessment A-Z of Geeky Acronyms Terrace Work Program 2004 Sillybus FAQ = Frequently Asked Questions Help

MySQL Housekeeping

Miscellaneous Commands

Readability Of Answer Tables

It is possible, and sometimes desirable, for mSQL to answer in sentences, rather that in table form. We can fake this by customising the select clause of the query, by adding descriptive littorals:

select artist,' recorded ',alb_name,' in ',p_date
from albums

results in an answer table with rows resembling:

band recorded album in date

As a courtesty to your user, littorals can make the difference between a cryptic answer table, and plain, easy to understand english.

You can use the "as" modifier in your select statements also:

select year(now())-pdate as age
from albums

effectively renames the answer table column, making it look nicer than the clumsy expression. This is more important in Access as it invents "Exp0001: " column headings which are ugly and confusing to users.


©Copyright t 1992..2018+. Edition 26.150117
Creative Commons License
This work is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 2.1 Australia License