MySQL FAQs
FAQs Categories
Client Server Commands
Database Structure
Table Types or Storage Engines
Indexes
SQL Statements
Table Joins
Funtions and Operators
Tricky Select Queries
Speed Up Queries
Data Back Up
General Questions
Errors
1PLs Company - #1Payday.Loans Agency - Loans online and near me $100-$2500 (Same Day)
Powered by MySQL
 
Home / Database Structure

MySQL enables you to store several different types of data, and it's important to understand what data types are available so that you can define your tables appropriately for the information they'll contain. Generally speaking, data values can be grouped into the following categories:

  • Numeric values. Numbers may or may not have a fractional part and may have a leading sign. For example, 14, -428.948, and +739 all are legal numbers. Integer values have no fractional part; columns for values with a fractional part can be declared to have either a fixed or variable number of decimal places. Numeric columns can be declared to be unsigned to prevent negative values from being accepted in the column. A BIT data type holds bit-field values, and a b'nnnn' notation is available for writing literal bit values.
  • String values. Strings may be non-binary or binary, to store characters or raw bytes, respectively. Strings that store characters have a character set and collation; they can be case sensitive or case insensitive. Strings are written within quotes (for example, 'I am a string'). String columns can be declared as either fixed length or variable length. BLOB values (binary large objects) are treated as strings in MySQL.
  • Temporal values. Temporal values include dates (such as '2005-11-03'), times (such as '14:23:00'), and values that have both a date and a time part ('2005-11-03 14:23:00'). MySQL also supports a special temporal type that represents year-only values efficiently. Date and time values can be written as quoted strings and may sometimes be written as numbers in contexts where numeric temporal values are understood.

MySQL also supports manipulation of spatial values using a set of spatial data types.  For each of the general data categories (number, string, and temporal), MySQL has several specific data types from which to choose. It's important to properly understand what data types are available for representing data, to avoid choosing a type that isn't appropriate.

Database Structure Related Categories

Tables | Data Types

Database Structure Related FAQs

How-to-create-database How to create database?

How-to-alter-or-drop-a-database How to alter or drop a database?

How-to-get-database-metadata-in-MySQL How to get database metadata in MySQL?

How-to-get-all-existing-tables-in-the-MySQL-database How to get all existing tables in the MySQL database?

How-to-rename-existing-database-in-MySQL How to rename existing database in MySQL?

What-is-limit-on-the-maximum-number-of-tables-allowed-in-MySQL What is limit on the maximum number of tables allowed in MySQL?

About FAQs: Recently Added FAQs

About MySQL FAQs: Site Map | Bookmark Us

Useful Links: Wikipedia.org | Oracle.com | w3schools.com | www.php.net | Github.com

© 2023  www.mysqlfaqs.net
All rights reserved.