MySQL
MySQL Data types
Last Updated: 28 May, 2023
MySQL supports a wide variety of data types that can be used to define columns in tables. Here are the most commonly used data types:
Numeric Types:
- INT: A standard integer type that can store signed integers from -2147483648 to 2147483647.
- BIGINT: A larger integer type that can store signed integers from -9223372036854775808 to 9223372036854775807.
- FLOAT: A floating-point number type that can store single-precision values.
- DOUBLE: A floating-point number type that can store double-precision values.
- DECIMAL: A fixed-point number type that can store exact values.
Date and Time Types:
- DATE: A date type that stores values in the format of "YYYY-MM-DD".
- TIME: A time type that stores values in the format of "HH:MM:SS".
- DATETIME: A combined date and time type that stores values in the format of "YYYY-MM-DD HH:MM:SS".
- TIMESTAMP: A timestamp type that stores values in the format of "YYYY-MM-DD HH:MM:SS".
String Types:
- CHAR: A fixed-length string type that can store up to 255 characters.
- VARCHAR: A variable-length string type that can store up to 65535 characters.
- TEXT: A large text type that can store up to 65535 characters.
- BLOB: A binary large object type that can store up to 65535 bytes of data.
Other Types:
- BOOLEAN: A boolean type that can store true or false values.
- ENUM: A list type that can store one value from a set of predefined values.
- SET: A list type that can store one or more values from a set of predefined values.
That's all, guys. I hope this MySQL article is helpful for you.
Happy Learning... 😀
Please share this article on social media to help others.
feedback@javabytechie.com
Currently No Video available