BIRT 3.7
Written by: Michael Williams
Featured Refcardz: Top Refcardz:
  1. Scrum
  2. Apache Maven 2
  3. Essential MySQL
  4. Node.js
  5. Groovy
  1. jQuery Selectors
  2. Ajax
  3. Java
  4. Spring Config.
  5. Java Concurrency

Link Details

Want better links on DZone? We do, too! Login and vote now.
Link 9890 thumbnail
User 212108 avatar

By legendx
via mikebernat.com
Published: Dec 28 2006 / 02:44

One of the biggest mistakes of today's fledgling MySQL programmers is their field type definitions, also known as data type or column type. Many are too quick to set up their tables, flying through the different options without giving it much thought. The time you spend setting up your tables will save you from many headaches later on down the road.
  • 22
  • 1
  • 2313
  • 0

Comments

Add your comment
User 205047 avatar

Lowell Heddings replied ago:

0 votes Vote down Vote up Reply

amen to that

User 213320 avatar

bjupton replied ago:

2 votes Vote down Vote up Reply

Amen indeed. I like the way you handled these as their similar groups.

Only criticism I would have is on the difference for when to use char vs. varchar, not that it is incorrect, just that it could be tightened up a bit.

For the same length string, varchar will take up more space than a char, so you should use char if this is a set length, like an account number or an SSN. On the other side, if you have a lot of variability in your lengths, then having the extra overhead on each might actually make the table smaller, than if you had every column at the length of the longest string.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.