Chapter 10. Creating Calculated Fields

In this chapter, you will learn what calculated fields are, how to create them, and how to use aliases to refer to them from within your application.

Understanding Calculated Fields

Data stored within a database’s tables is often not available in the exact format needed by your applications. Here are some examples:

  • You need to display a field containing the name of a company along with the company’s location, but that information is stored in separated table columns.

  • City, state, and ZIP Code are stored in separate columns (as they should be), but your mailing label printing program needs them retrieved as one correctly formatted field.

  • Column data is in mixed upper- and lowercase, and your report needs all data ...

Get MySQL® Crash Course now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.