Chapter 1: Values, Variables, Functions, and Expressions

In This Chapter

arrow Discovering valid values for table columns

arrow Summarizing data with set functions

arrow Dissecting data with value functions

arrow 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. Rather than 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 I, 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


Special variables

I discuss each in turn throughout this section.

Row values have multiple parts

A row value includes the values of ...

Get SQL All-in-One For Dummies®, 2nd Edition now with O’Reilly online learning.

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