Skip to content

MySQL – SQL Quick Reference Guide

MySQL is a fairly comprehensive database management system. It’s hard to remember all the functions, queries, and data types. To help developers, this article provides a SQL memento.

Memory aid

MySQL cheat sheet

Content of SQL flag

This memento presents examples of common SQL queries in order to remember the syntax to use. There is also a reminder of the data types:

  • Numeric columns: TINYINT, SMALLINT, MEDIUMINT, INT, INTEGER, BIGINT, FLOAT, DOUBLE PRECISION, REAL, DECIMAL
  • Text columns: CHAR, VARCHAR, TINYTEXT, TINYBLOB, TEXT, BLOB, LONGTEXT, LONGBLOB, ENUM, SET
  • Date and time columns: DATE, DATETIME, TIMESTAMP, TIME, YEAR

Finally, a large part of this memory aid consists of a reminder of SQL functions. We find the finds classified by type:

  • Mathematical functions: CEIL (), FLOOR (), RAND (), TRUNCATE () …
  • Date functions: CURRENT_DATE, DATE (), MAKEDATE (), MAKETIME (), NOW (), TIMEDIFF (), UNIX_TIMESTAMP (), WEEK (), YEAR () …
  • Functions on character strings: CHAR_LENGTH (), CONCAT (), LENGTH (), LOWER (), LPAD (), LTRIM (), REPLACE (), RTRIM (), SOUNDEX (), SUBSTRING (), TRIM () …