0% found this document useful (0 votes)
315 views

MySQL Cheat Sheet PDF

This document is a MySQL cheat sheet that summarizes MySQL data types, functions, and other elements. It includes summaries of MySQL string functions, date and time functions, mathematical functions, and grouping functions. The cheat sheet also lists MySQL data types and provides information on type conversion and control flow functions.

Uploaded by

Esha Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
315 views

MySQL Cheat Sheet PDF

This document is a MySQL cheat sheet that summarizes MySQL data types, functions, and other elements. It includes summaries of MySQL string functions, date and time functions, mathematical functions, and grouping functions. The cheat sheet also lists MySQL data types and provides information on type conversion and control flow functions.

Uploaded by

Esha Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MySQL Cheat Sheet

by Dave Child (DaveChild) via cheatography.com/1/cs/16/


MySQL Data Types

MySQL Type Conversion

MySQL String Functions (cont)

CHAR

String (0 - 255)

BINARY 'string'

LENGTH

REPEAT

VARCHAR

String (0 - 255)

CAST (expression AS datatype)

CHAR_LENGTH

REVERSE

TINYTEXT

String (0 - 255)

CONVERT (expression, datatype)

BIT_LENGTH

INSERT

TEXT

String (0 - 65535)

LOCATE

ELT

BLOB

String (0 - 65535)

INSTR

FIELD

MEDIUMTEXT

String (0 - 16777215)

AVG

MAX

LPAD

LCASE

String (0 - 16777215)

BIT_AND

STD

RPAD

UCASE

String (0 - 4294967295)

BIT_OR

STDDEV

LEFT

LOAD_FILE

String (0 - 4294967295)

COUNT

SUM

RIGHT

QUOTE

TINYINT x

Integer (-128 to 127)

GROUP_CONCAT

VARIANCE

SMALLINT x

Integer (-32768 to 32767)

MIN

MEDIUMINT x

Integer (-8388608 to

MEDIUMBLOB
LONGTEXT
LONGBLOB

8388607)
INT x
BIGINT x

MySQL Grouping Functions

MySQL Date and Time Functions

MySQL Mathematical Functions

DAYOFWEEK

DATE_SUB

WEEKDAY

ADDDATE

Integer (-2147483648 to

ABS

COS

DAYOFMONTH

SUBDATE

2147483647)

SIGN

SIN

DAYOFYEAR

EXTRACT

Integer (-

MOD

TAN

MONTH

TO_DAYS

FLOOR

ACOS

DAYNAME

FROM_DAYS

CEILING

ASIN

MONTHNAME

DATE_FORMAT

ROUND

ATAN, ATAN2

QUARTER

TIME_FORMAT

DIV

COT

WEEK

CURRENT_DATE

EXP

RAND

YEAR

CURRENT_TIME

LN

LEAST

YEARWEEK

NOW

LOG, LOG2, LOG10

GREATEST

HOUR

SYSDATE

POW

DEGREES

MINUTE

UNIX_TIMESTAMP

POWER

RADIANS

SECOND

FROM_UNIXTIME

SQRT

TRUNCATE

PERIOD_ADD

SEC_TO_TIME

PERIOD_DIFF

TIME_TO_SEC

9223372036854775808 to
9223372036854775807)
FLOAT

Decimal (precise to 23 digits)

DOUBLE

Decimal (24 to 53 digits)

DECIMAL

"DOUBLE" stored as string

DATE

YYYY-MM-DD

DATETIME

YYYY-MM-DD HH:MM:SS

TIMESTAMP

YYYYMMDDHHMMSS

TIME

HH:MM:SS

ENUM

One of preset options

SET

Selection of preset options

Integers (marked x) that are "UNSIGNED" have


the same range of values but start from 0 (i.e.,
an UNSIGNED TINYINT can have any value
from 0 to 255).

PI
MySQL String Functions

DATE_ADD

ASCII

SUBSTRING

MySQL Control Flow Functions

ORD

MID

IF

CONV

SUBSTRING_INDEX

IFNULL

BIN

LTRIM

OCT

RTRIM

HEX

TRIM

CHAR

SOUNDEX

CONCAT

SPACE

CONCAT_WS

REPLACE

NULLIF

By Dave Child (DaveChild)

Published 19th October, 2011.

Sponsored by Readability-Score.com

cheatography.com/davechild/

Last updated 29th June, 2014.

Measure your website readability!

www.addedbytes.com

Page 1 of 2.

https://readability-score.com

MySQL Cheat Sheet

by Dave Child (DaveChild) via cheatography.com/1/cs/16/


MySQL Miscellaneous Functions
BIT_COUNT

DES_ENCRYPT

DATABASE

DES_DECRYPT

USER

LAST_INSERT_ID

SYSTEM_USER

FORMAT

SESSION_USER

VERSION

CURRENT_USER

CONNECTION_ID

PASSWORD

GET_LOCK

OLD_PASSWORD

RELEASE_LOCK

ENCRYPT

IS_FREE_LOCK

DECODE

BENCHMARK

MD5

INET_NTOA

SHA1

INET_ATON

AES_ENCRYPT

FOUND_ROWS

AES_DECRYPT

STRCMP

By Dave Child (DaveChild)

Published 19th October, 2011.

Sponsored by Readability-Score.com

cheatography.com/davechild/

Last updated 29th June, 2014.

Measure your website readability!

www.addedbytes.com

Page 2 of 2.

https://readability-score.com

You might also like