The moose likes JDBC and Relational Databases and the fly likes help with basic SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "help with basic SQL" Watch "help with basic SQL" New topic

help with basic SQL

André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
hi, I have a basic doubt of SQL language structurei, look at:

bigint, int, smallint, tinyint but what is more used? varchar?

e.g: a columm with 11 numbers of identification as (CPF from Brazil) must I use int (11) or varchar (100) or another one?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45365
Please explain more details. What's a CPF? If you have a fixed number of characters, particularly if they start with "000" char(11) might be a better format.
I agree. Here's the link:
subject: help with basic SQL
It's not a secret anymore!