Data types Flashcards
(18 cards)
VARCHAR
string of various length (example – person’s name)
TEXT
long text strings, no length specification needed (example – product
description)
BLOB
binary large object, stores data like audio, video, images, files (example – product image)
CHAR
string of fixed length, adds spaces to the end of string to make it the
correct length
BINARY
Fixed-length binary string
VARBINARY
Variable-length binary string
ENUM
A list of predefined values where one can be entered. If adding a value not in the list, you get an empty string (example – clothing sizes
SET
A list of predefined values where zero or many can be entered (example – clothing sales seasons)
INT
A standard integer, no decimals/fractions (signed – zero and positive
numbers; unsigned – zero, positive, and negative numbers)
FLOAT
Storing an approximate decimal value with 6-9 significant figures
DOUBLE
Storing an approximate decimal value, more precise version of a
float with 15-17 significant figures
DECIMAL
specify maximum number of digits and the number of decimals.
Good for accuracy with 28-29 significant figures
BIT
binary values, either 0s or 1s, up to a certain length
DATE
date value in CCYY-MM-DD format
TIME
time value in hh:mm:ss format
YEAR
year value in CCYY or YY format
DATETIME
date and time value in CCYY-MM-DD hh:mm:ss format (no
timezone information)
TIMESTAMP
timestamp value in CCYY-MM-DD hh:mm:ss format