What Is Expression

This section provides quick introductions of main expression categories: numeric, character string, bit string, data and time, and time interval.

Value Expressions: Syntax forms to express operations against data values. SQL divides value expressions into several categories: numeric expressions, character string expressions, bit string expressions, date and time expressions, and time interval expressions.

1. Numeric value expressions are operations that involve numeric values. Examples:

1 + 1
2 / 3
100 * (1 + 0.05) * (1 + 0.06)

2. Character string expressions are operations that involve character strings. Examples:

'Hello' || ' world!' -- Concatenation, not supported by MySQL

3. Bit string expressions are operations that involve bit strings. Examples:

~ x'01' -- Negation

4. Date and time expressions are operations that involve data and time values, and time interval values. Examples:

date '1999-01-01' + interval '1' year; -- adding 1 year
timestamp '1999-01-01 01:02:03' + interval '1' minute -- adding 1 minute

Since expressions are made up by operations, let's look at some of commonly used operations in sections below.

Last update: 2015.

Table of Contents

 About This Book

 Introduction of SQL

 MySQL Introduction and Installation

 Introduction of MySQL Programs

 Perl Programs and MySQL Servers

 PHP Programs and MySQL Servers

 Java Programs and MySQL Servers

 Datatypes and Data Literals

Operations and Expressions

What Is Expression

 Arithmetic Operations

 Predicate Operations

 Date and Time Operations

 Examples of Different Types of Operation

 Character Strings and Bit Strings

 Commonly Used Functions

 Table Column Types for Different Types of Values

 Using DDL to Create Tables and Indexes

 Using DML to Insert, Update and Delete Records

 Using SELECT to Query Database

 Transaction Management and Isolation Levels

 Locks Used in MySQL

 Defining and Calling Stored Procedures

 Variables, Loops and Cursors Used in Stored Procedures

 Outdated Tutorials

 References

 PDF Printing Version