Wednesday, February 16, 2005
mySQL Hour 7
Hour 7 promises to teach:
Data Types
Three types of data type:
i'll finish that table off later if i get time...
we continue...
- data types
- table creation syntax
- preliminary statements to create tables
Data Types
Three types of data type:
- numeric
- data and time
- string
Numeric | Properties | Date and Time | Properties | String | Properties |
TINYINT | -128 to 127 or 0 to 255 | DATE | YYYY-MM-DD | CHAR | |
SMALLINT | -32768 to 32767 or 0 to 65535 | DATETIME | YYYY-MM-DD HH:MM:SS | VARCHAR | |
MEDIUMINT | -8388608 to 8388607 or 0 to 16777215 | TIMESTAMP | default length is 14 which stores YYYYMMDDHHMMSS less than length 14 stores less | BLOB or TEXT | |
INT or INTEGER | -2147483648 to 2147483647 or 0 to 4294967295 | TIME | HH:MM:SS | TINYBLOB or TINYTEXT | |
BIGINT | -2147483648 to 2177483647 or 0 to 18446744073709551615 | YEAR | YY or YYYY default length is 4 | MEDIUMBLOB or MEDIUMTEXT | |
FLOAT (M,D) | up to 24 d.p. | LONGBLOB or LONGTEXT | |||
DOUBLE (M,D) or REAL (M,D) | up to 53 d.p. | ENUM | |||
DECIMAL (M,D) or NUMERIC(M,D) | each digit is one byte |
i'll finish that table off later if i get time...
we continue...