Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MySQL Data Types     - Ubuntu install Tonido private cloud services (Server)

- How to install Wine 1.7.20 under Ubuntu or Linux Mint (Linux)

- The ActiveMQ JMS installation and application examples for Linux (Linux)

- Security Knowledge: redirection command application security (Linux)

- RedHat Linux 6.4 install Oracle 10g error (Database)

- Top 10: HTML5, JavaScript 3D game engine and framework (Linux)

- Ubuntu Linux to create and increase the Swap partition tutorial (Linux)

- Windows and Ubuntu dual system, repair of two ways UEFI boot (Linux)

- Attic-- delete duplicate data backup program (Linux)

- Android application security of data transmission security (Programming)

- Port Telnet command to detect the remote host is turned on (Linux)

- Create several practical points of high security PHP site (Linux)

- MySQL and MariaDB new master from the cluster configuration GTID (Database)

- Regular expressions in Perl (Programming)

- Ubuntu 14.04 install Sublime Text 3 plug and use SublimeClang (Linux)

- Archlinux installation tutorial (Linux)

- Nginx-1.9.7 TCP reverse proxy (Server)

- Graphics of Java Tools (Programming)

- Ubuntu Gitolite management Git Server code base permissions (Server)

- Why do I prefer Git (Linux)

 
         
  MySQL Data Types
     
  Add Date : 2017-01-08      
         
         
         
  In MySQL, there are three main types: text, numeric, and date / time types.

Text Type:

Data Type Description
CHAR (length) to save the fixed-length string (can contain letters, numbers, and special characters). Specifies the length of the string in parentheses. Up to 255 characters.
VARCHAR (length)
Save a variable length string (can contain letters, numbers, and special characters). Specify the maximum length of the string in parentheses. Up to 255 characters.

Note: If the length is greater than 255 it will be converted to a TEXT type.

TINYTEXT store a maximum length of 255 characters in a string.
TEXT storage of a maximum length of 65,535 characters in a string.
BLOB for BLOBS (Binary Large OBjects). Contain up to 65,535 bytes of data.
MEDIUMTEXT store a maximum length of 16,777,215 characters in a string.
MEDIUMBLOB for BLOBs (Binary Large OBjects). Contain up to 16,777,215 bytes of data.
LONGTEXT store a maximum length of string 4,294,967,295 characters.
LONGBLOB for BLOBs (Binary Large OBjects). Contain up to 4,294,967,295 bytes of data.
ENUM (a, b, c, d, ...)
It allows you to enter a list of possible values. You can list up to 65535 values in an ENUM list. If the list does not exist in the value inserted, insert the null value.

Note: These values are in the order you enter the store.

SET Similar to ENUM, SET can contain up to 64 list items and can store more than one SET of.
Number Type:

Data Type Description
TINYINT (length) -128 to 127 conventional. Unsigned * 0-255. Maximum number of digits in parentheses. 1 byte
SMALLINT (length) -32768 to 32767 routine. 0-65535 unsigned *. Maximum number of digits in parentheses. 2 bytes
MEDIUMINT (length) -8388608 to 8388607 ordinary. 0-16777215 unsigned *. Maximum number of digits in parentheses. 3 byte
INT (length) -2147483648 to 2147483647 routine. 0-4294967295 unsigned *. Maximum number of digits in parentheses. 4 bytes
BIGINT (length) -9223372036854775808 to 9223372036854775807 routine. 0-18446744073709551615 unsigned *. Maximum number of digits in parentheses. 8 bytes
Small digital FLOAT (length, d) with a floating decimal point. In parentheses length specifies the maximum number of bits, d parameter specifies the maximum number of bits to the right of the decimal point.
DOUBLE (length, d) a large number with a floating decimal point. In parentheses length specifies the maximum number of bits, d parameter specifies the maximum number of bits to the right of the decimal point.
DECIMAL (length, d) A DOUBLE stored as a string, allowing for a fixed decimal point.
* Integer types have an extra option UNSIGNED. Typically, the integer can be negative or positive. Adding the UNSIGNED attribute, the range starts at zero instead of a negative.

* Length refers to the maximum display width, the width of the display range of values stored independent of the size or type includes, for example, int (1), not to be understood as only store 0-9, you can not save more than 10, he was just telling I want to store the database data width of 1, but then as long as the scope of its storage type is normally stored.

* Byte (byte) is generally represented by B, smaller than a byte, the bit bit, usually represented by b, 1B = 8b 1KB = 1024B 1MB = 1024KB

* Select UNSIGNED column does not allow negative, we chose ZEROFILL column on the left with zeros in the value added

Date Type:

Data Type Description
DATE ()
date. Format: YYYY-MM-DD

Note: The supported range is from '1000-01-01' to '9999-12-31'

DATETIME ()
* A combination of date and time. Format: YYYY-MM-DD HH: MM: SS

Note: The supported range is from '1000-01-01 00:00:00' to '9999-12-31 23:59:59'

TIMESTAMP ()
* Timestamp. TIMESTAMP values using the Unix epoch ( '1970-01-01 00:00:00' UTC) to store the description so far. Format: YYYY-MM-DD HH: MM: SS

Note: The supported range is from '1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC

TIME () time. Format: HH: MM: SS Note: The supported range is from '-838: 59: 59' to '838: 59: 59'
YEAR ()
In 2 or 4 format.

Note: 4 format allows values: from 1901 to 2155.2 format allows values: 70-69 showing, from 1970-2069.

* Even if DATETIME and TIMESTAMP return the same format, they work very differently. In the INSERT or UPDATE query, TIMESTAMP automatically set itself to the current date and time. TIMESTAMP also accepts various formats, such as YYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD or YYMMDD.
     
         
         
         
  More:      
 
- To install Git on Ubuntu systems (Server)
- Access clipboard content across multiple vim instances in a terminal (Linux)
- Mutt - an email client that sends messages through the terminal (Linux)
- Linux platform Oracle MySQL connection (Database)
- IOwait Linux system monitoring diagnostic tools (Linux)
- JavaScript basic types and type conversion (Programming)
- socket busy poll of Linux kernel 3.11 to avoid sleep switch (Linux)
- Android application simulates the phone keypad (Programming)
- Android Studio commonly used shortcuts and how to follow the Eclipse Shortcuts (Linux)
- The Sublime Text 3 configuration file (Linux)
- How to use the ftp tool to transfer files between Windows and Linux (Linux)
- Installation and use the telnet command under CentOS 6.x (Linux)
- CentOS 7.0 local address and configure yum source address priority (Linux)
- Ubuntu Learning Advanced article - to teach you to further enhance system security (Linux)
- Customize own small private Linux system (Linux)
- Oracle physical storage structure outline (Database)
- Apache Spark1.1.0 deployment and development environment to build (Server)
- Oracle row and column switch to turn columns (Database)
- Computer security perimeter recommendations (Linux)
- See how --nand flash timing diagram of a read operation Comments (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.