0% found this document useful (0 votes)
116 views2 pages

Mysql Cheat Sheet: by Via

This document is a MySQL cheat sheet that provides summaries of MySQL data types, functions, and other elements. It includes lists and descriptions of string, mathematical, date/time, control flow, and miscellaneous functions as well as data types like CHAR, VARCHAR, TEXT, and ENUM. The cheat sheet serves as a quick reference guide to common MySQL elements for users.

Uploaded by

Manan Patel
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)
116 views2 pages

Mysql Cheat Sheet: by Via

This document is a MySQL cheat sheet that provides summaries of MySQL data types, functions, and other elements. It includes lists and descriptions of string, mathematical, date/time, control flow, and miscellaneous functions as well as data types like CHAR, VARCHAR, TEXT, and ENUM. The cheat sheet serves as a quick reference guide to common MySQL elements for users.

Uploaded by

Manan Patel
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

INSTR

FIELD

MySQL Grouping Functions

BLOB

String (0 - 65535)

MEDIUMTEXT

String (0 - 16777215)

AVG

MAX

LPAD

LCASE

MEDIUMBLOB

String (0 - 16777215)

BIT_AND

STD

RPAD

UCASE

LONGTEXT

String (0 - 4294967295)

BIT_OR

STDDEV

LEFT

LOAD_FILE

LONGBLOB

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

INT x

BIGINT x

DECIMAL
DATE
DATETIME
TIMESTAMP
TIME
ENUM
SET

DATE_SUB

8388607)

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

9223372036854775807)

DOUBLE

DAYOFWEEK
MySQL Mathematical Functions

9223372036854775808 to

FLOAT

MySQL Date and Time Functions

Decimal (precise to 23 digits)


Decimal (24 to 53 digits)
"DOUBLE" stored as string
YYYY-MM-DD
YYYY-MM-DD HH:MM:SS
YYYYMMDDHHMMSS
HH:MM:SS
One of preset options
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