10. 16. 1. 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. |