MySQL Tutorials - Herong's Tutorial Examples - v4.46, by Herong Yang
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.
Table of Contents
MySQL Introduction and Installation
Introduction of MySQL Programs
Perl Programs and MySQL Servers
Java Programs and MySQL Servers
Collations in Predicate Operations
Examples of Different Types of Operation
Character Strings and Bit Strings
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
Window Functions for Statistical Analysis
Use Index for Better Performance
Transaction Management and Isolation Levels
Defining and Calling Stored Procedures
Variables, Loops and Cursors Used in Stored Procedures
System, User-Defined and Stored Procedure Variables
Storage Engines in MySQL Server
InnoDB Storage Engine - Primary and Secondary Indexes
Performance Tuning and Optimization
Installing MySQL Server on Linux