Common MySQL data types


Posted by Ben Johnson on 28 August 2011 | 1 Comments

Tags: ,,

When designing a new database, each time I have to re-think what types should be used for one or the other columns. So I decided to make my own mainly just for reference but somebody may find this useful.

Column Data Type Comment
id
INT AUTO_INCREMENT, UNSIGNED
page name
VARCHAR(64)  
meta title
VARCHAR(150)  
meta description
VARCHAR(160)  
meta keyword
VARCHAR(255)  
status enum('ENABLED','DISABLED') DEFAULT "DISABLED"
featured TINYINT(1) DEFAULT "0"
content TEXT
username VARCHAR(32)
password VARCHAR(64)
email address VARCHAR(100)

phone/mobile VARCHAR(20)

firstname/company VARCHAR(32)

address_1 VARCHAR(128)
postcode VARCHAR(10)
file VARCHAR(255)  
price DECIMAL (7,2)  UNSIGNED
order INT(11)  
ip VARCHAR(15) DEFAULT "0"
modified TIMESTAMP on update CURRENT_TIMESTAMP
create DATETIME DEFAULT "0000-00-00 00:00:00"
forien_key INT(11)  

Post your comment

Posting comments has been disabled.

Comments

  • Hello our family simply love your beautiful article thanks and pls keep on it

    Posted by ExamsKing, 10/02/2012 2:43pm (2 years ago)

RSS feed for comments on this page | RSS feed for all comments