Chapter 1

Values, Variables, Functions, and Expressions


Bullet Discovering valid values for table columns

Bullet Summarizing data with set functions

Bullet Dissecting data with value functions

Bullet Converting data types

This chapter describes the tools that ISO/IEC standard SQL provides to operate on data. In addition to specifying the value of a data item, you can slice and dice an item in a variety of ways. Instead of just retrieving raw data as it exists in the database, you can preprocess it to deliver just the information you want, in the form that you want it.

Entering Data Values

After you’ve created a database table, the next step is to enter data into it. SQL supports a number of different data types. (Refer to Book 1, Chapter 6 for coverage of those types.) Within any specific data type, the data can take any of several forms. The five different forms that can appear in table rows are

  • Row values
  • Column references
  • Literal values
  • Variables
  • Special variables

I discuss each in turn throughout this section.

Row values have multiple parts

A row value includes the values of all the ...

Get SQL All-in-One For Dummies, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.