O'Reilly logo

MySQL in a Nutshell by Russell J.T. Dyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. SQL Statements

This chapter provides brief but comprehensive explanations of the clauses, flags, and options in MySQL’s extensive implementation of SQL. While this chapter covers some new material in Version 5.0 of MySQL, some features are left out, because they were not firm at the time of this writing.

This chapter starts with a list of statements grouped by type, as a quick reference. Following this, the statements are listed in alphabetical order. For the more complex statements, to simplify their presentation, the syntax is broken into several sections according to the different uses of the statement.

Some general elements of MySQL’s SQL syntax include the following:

  • SQL statements may span multiple lines, but must end with either a semi-colon or \G.

  • When values are enclosed in parentheses, multiple values usually can be specified, separated by commas.

  • Strings and dates must be specified within single or double quotes.

  • Elements of a statement’s syntax are case-insensitive. However, on Unix-type systems, database and table names, as well as filenames, are case-sensitive.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required