MySQL Tutorials - Herong's Tutorial Examples - v4.46, by Herong Yang
Predicate Operations
This section provides a list of predicate operations supported by MySQL with some examples.
Predicate operations are operations that can be evaluated to give a condition of true or false:
1. "Comparison" Predicates: Compares two values of the same type according to a predefined order. There are 6 comparison operations:
2. "Between" Predicates: Check a given value against a value range. There are 2 "between" operations:
3. "In" Predicates: Check a given value against a list of values. There are 2 "in" operations:
4. "Like" Predicates: Check a given character string against a character pattern. By default "Like" operations are not case sensitive. There are 2 "Like" operations:
"pattern" is a character string with wildcard characters and escape sequences:
Examples:
'abc' LIKE 'Abc' -- true '3.14' LIKE '_.__' -- true '3.14159' LIKE '3.%' -- true 'herong_yang' LIKE 'herong\_yang' -- true '4.75%' LIKE '_.__\%' -- true
5. "Null" Predicates: Check a given value against null value. There are 2 "Null" operations:
Examples:
1 IS NULL -- false 'a' IS NOT NULL -- true NULL IS NULL -- true NULL IS NOT NULL -- false
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