VisiBone home page
home > SQL Products   

MySQL cheatsheets — Brilliant people forget stuff. — So clearly you need these.

  “Life's too short to be remembering all this stuff and this is the ideal 'offline storage'.”  — Colin B.
MySQL Card
4-page  8.5" x 11" 
two-piece, laminated cards
Page 1: Statements A-G Page 2: Statements H-Z Page 3: Functions A-L Page 4: Functions M-Z
Statements ... Functions

ADD TO CART
$15

CLOSE-UPS
page 1, 2, 3, 4


Features:

  • 8.5" x 11"
    (22cm x 28cm)
     
  • Portable
    quick-
    reference
    guide
     
  • Laminated
     
  • Readable
    (9 point type)
 “Amazing.  Who says the era of great american toolmaking is over?.  This is the kind of thing that feels good in my hands.
Even though I figure I won't use 80% of the commands you show, I already learned quite a bit in the SELECT section.”
 — Greg C.

“EXCELLENT WORK!   I look forward to buying, reading, and learning.”  — Philip L.
MySQL Charts
set of two wall posters

MySQL Chart
Statements


Functions

Small:
 
17" x 24.1"
each
(43cm x 61cm)
MATTE

ADD TO CART
$20 for the pair
GLOSSY

ADD TO CART
$20 for the pair


Large:
 
24" x 34.1"
each
(61cm x 87cm)
MATTE

ADD TO CART
$30 for the pair
GLOSSY

ADD TO CART
$30 for the pair


JOIN tables - exploit relationships Both Card and Chart:
  • Identical content 
     
  • MySQL version 5.2
    (aka 6 alpha)

  • ISO/ANSI SQL:2003
    compatibility is color-
    coded ( nonstandard 
    features are colored blue)
     
  • 182 tested examples of
    functions and operators
     
  • Case Symbol for: case sensitive (upper and lower case matter)sensitivity and
    Symbol for: case insensitive (upper and lower case DON'T matter)insensitivity for names
    and types
“All arrive and distributed out.
People oooo'd and aaaaaa'd.
What would we change? Nothing -
we just want more.”

        — Mark Lentczner, Linden Lab
 
“You have done the world a
favor with the MySQL sheets
as well as your previous work.”

        — Phil Payne, Edgewood, NM
  • 84 Statements: ALTER, ANALYZE, BACKUP, BEGiN, CACHE,
    CALL, CASE, CHECK, CHECKSUM, CLOSE, COMMIT,
    CREATE, DEALLOCATE, DELETE, DESCRIBE, DO, DROP,
    EXECUTE, EXPLAIN, FETCH, FLUSH, GRANT, HANDLER,
    IF, INSERT, ITERATE, KILL, LEAVE, LOAD, LOCK, LOOP,
    OPEN, OPTIMIZE, PREPARE, RENAME, REPAIR, REPEAT,
    REPLACE, RESET, RESTORE, REVOKE, ROLLBACK,
    SAVEPOINT, SELECT, SET, SHOW, START, TRUNCATE,
    UNION, UNLOCK, UPDATE, USE, WHILE

“If you find out who or where to get a copy of that MySQL poster that Monty was carrying around, I'd be
very interested in getting a copy for my office here at Google.”

—David Perron, Google's Manhattan Office, to another attendee of the MySQL Conference & Expo 2007

Legend



  • Highlighted what you'll use and look up a lot, e.g.:
    INSERT, SELECT, CONCAT(), IF(), NOW(),
    POSITION(), REPLACE(), SUBSTRING(),
    SUBSTRING_INDEX().
     
  • 240 Functions and operators: ABS(), ACOS(),
    ADDDATE(), ADDTIME(), AES_DECRYPT(),
    AES_ENCRYPT(), AND, ASCII(), ASIN(),
    ATAN(), ATAN2(), AVG(), BENCHMARK(),
    BETWEEN, BIN(), BINARY(), BIT_AND(),
    BIT_COUNT(), BIT_LENGTH(), BIT_OR(),
    BIT_XOR(), CASE, CAST(), CEILING(), CHAR(),
    CHAR_LENGTH(), CHARACTER_LENGTH(),
    CHARSET(), COALESCE(), COERCIBILITY(),
    COLLATE(), COLLATION(), COMPRESS(),
    CONCAT(), CONCAT_WS(), CONNECTION_ID(),
    CONV(), CONVERT, CONVERT_TZ(), COS(),
    COT(), COUNT(), CRC32(), CURRENTDATE(),
    CURDATE(), CURRENT_TIME(), CURTIME(),
    CURRENT_TIMESTAMP(),
    CURRENT_USER(), DATABASE(), DATE(),
    DATE_ADD(), DATEDIFF(),
    DATE_FORMAT(), DATE_SUB(), DAY(),
    DAYNAME(), DAYOFMONTH(),
    DAYOFWEEK(), DAYOFYEAR(), DECODE(),
    DEFAULT(), DEGREES(), DES_ENCRYPT(),
    DES_DECRYPT(), DIV, ELT(), ENCODE(),
    ENCRYPT(), EXP(), EXPORT_SET(),
    EXTRACT(), FIELD(), FIND_IN_SET(), FLOOR(),
    FORMAT(), FOUND_ROWS(), FROM_DAYS(),
    FROM_UNIXTIME(), GET_FORMAT(),
    GET_LOCK(), GREATEST(),
    GROUP_CONCAT(), HEX(), HOUR(), IF(),
    IFNULL(), IN(), INET_ATON(), INET_NTOA(),
    INSERT(), INSTR(), INTERVAL(), ISNULL(), IS,
    IS_FREE_LOCK(), IS_USED_LOCK(),
    LAST_DAY(), LAST_INSERT_ID(), LEAST(),
    LEFT(), LENGTH(), LIKE, LN(), LOAD_FILE(),
    LOCALTIMESTAMP(), LOCATE(), LOG(),
    LOG10(), LOG2(), LOWER(), LCASE(), LPAD(),
    LTRIM(), MAKEDATE(), MAKE_SET(),
    MAKETIME(), MATCH(), MAX(), MD5(),
    MICROSECOND(), MID(), MIN(), MINUTE(),
    MOD(), MONTH(), MONTHNAME(), NOT,
    NOW(), NULLIF(), OCT(), OCT_LENGTH(),
    OLD_PASSWORD(), OR, ORD(),
    PASSWORD(), PERIOD_ADD(),
    PERIOD_DIFF(), PI(), POSITION(), POWER(),
    QUOTE(), QUARTER(), RADIANS(), RAND(),
    REGEXP, RELEASE_LOCK(), REPEAT(),
    REPLACE(), REVERSE(), RIGHT(), RLIKE,
    ROUND(), ROW_COUNT(), RPAD(), RTRIM(),
    SCHEMA(), SECOND(), SEC_TO_TIME(),
    SESSION_USER(), HAHA() MADE(), YOU(), LOOK(),
    SHA1(), SIGN(), SIN(), SLEEP(), SOUNDS LIKE,
    SOUNDEX(), SPACE(), SQRT(), STDDEV(),
    STDDEV_POP(), STDDEV_SAMP(), STR_TO_DATE(),
    STRCMP(), SUBDATE(),
    SUBSTRING(),
    SUBSTRING_INDEX(), SUBTIME(), SUM(), SYSDATE(),
    SYSTEM_USER(), TAN(), TIME(), TIMEDIFF(),
    TIMESTAMP(), TIMESTAMPADD(), TIMESTAMPDIFF(),
    TIME_FORMAT(), TIME_TO_SEC(), TO_DAYS(),
    TRIM(), TRUNCATE(), UNCOMPRESS(),
    UNCOMPRESSED_LENGTH(), UNHEX(),
    UNIX_TIMESTAMP(), UPPER(), UCASE(), USER(),
    UTC_TIMESTAMP(), UTC_DATE(), UTC_TIME(), UUID(),
    VALUES(), VAR_POP(), VAR_SAMP(), VERSION(),
    WEEK(), WEEKDAY(), WEEKOFYEAR(),
    WEIGHT_STRING(), XOR, YEAR(), YEARWEEK(),
    :=, ||, &&, =, <=>, <>, !=, <, <=, >, >=, |, &, <<, >>,
    -, +, *, /, %, ^, ~, -, !
  • Mysteries unraveled:
     
    • SUBSTRING_INDEX() parsing
       
    • JOIN as column-glue – what LEFT,
      RIGHT, INNER, OUTER, NATURAL,
      ON, and USING really mean
       
    • UNION as row-glue
       
    • GROUP_CONCAT()  2-dimensional
      string concatenation
       
    • Storage details: CHAR, BINARY,
      TEXT, BLOB, VARCHAR, and
      VARBINARY, plus the variations:
      TINY, MEDIUM, SMALL, LONG, BIG
      and what they really give you
       
    • back-tick `quotes` – when to use
       
    • NULL as a computational black hole
       
    • WEEK() and YEARWEEK()
      numbering schemes – calendar
      versatility
       
  • MySQL in its natural habitat: PHP and
    command-line examples
     
  • Operator precedence
     
  • Regular expression parts, examples
     
  • Date and time formatting codes,
    examples, and equivalent functions
     
  • Column aliases – where they're
    welcome (GROUP BY, HAVING,
    ORDER BY) and where they can't
    be used (WHERE clause, column
    expressions)
This is how you delete a database, what ISO calls a schema:
     
Dropping a nonexistent database is ordinarily an error.
MySQL forgives this when you use the This little checkbox-like thing means "optional"optional phrase
IF EXISTS – but that's  nonstandard.
 

Format dates and times fast with clues from the example columns.
See the difference between %d and %e?  Clear as day?

 
Here's some content you won't find anywhere else: what those wacky
week numbering schemes mean in practical terms. The manual sure
leaves you wondering what-were-they-thinking. Turns out, it's brilliant:

Some MySQL functions:

As the Legend (above) helps explain, POSITION()'s return value Symbol for: 1-based counting counts from one.  It is Symbol for: zero means not-found zero for not found.
 

Supporting details online: 

 

Browser BookSee also the 16-page Browser Book
a complete set of cheatsheets
for client-side web design,
covering XHTML, CSS, fonts,
colors, special characters,
JavaScript and more.

Browser BookOr, the 28-page Book Collection
combines the Browser Book
with the PHP Big Book
and the MySQL Card.

.