Using Operators with Strings

In the previous lesson, you saw how arithmetic and comparison operations were performed on numeric values. Now you’ll see the ways in which you can work with strings in MySQL.


A string is simply a collection of characters treated as a single data item, either returned from a database column that contains characters or enclosed in single quotes in a SQL statement.

Comparison Operators

The comparison operators you are already familiar with translate to string values in a logical way. The equals and not equals operators work almost as you would expect, but MySQL is not case sensitive when comparing characters. ...

Get Sams Teach Yourself MySQL now with O’Reilly online learning.

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