The basic datatypes : Introduction : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » Introduction »

 

The basic datatypes


Datatype Description Example:
INT Numeric entry id INT
VARCHAR(n) Text string of characters up to n with a maximim of 255 characters myVarChar VARCHAR(20)
CHAR(n) Text string with specific number (n) of characters. myChar CHAR(30)
TEXT Holds between 255 - 65535 characters myText TEXT
DATE The date stored in the format YYYY-MM-DD myDate DATE
TIME The time stored in the format HH:MM:SS myTime TIME


The syntax for defining a field and datatype is 'fieldname datatype'.

If string length in CHAR(n) Column is less than 'n' then the string is padded by spaces (spaces are removed when data is retrieved).

n for CHAR(n) is 255 Maximum.




Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» Introduction