I'm trying to get a handle on the column data types for my DB and I've got a few questions.
1) When a row is inserted, does each column automatically take the maximum amount of space that was allotted to it? Or does it only take as much space needed for the data that was actually stored? I ask because I want to make sure that I use a data type that is large enough to store what it needs but I don't want it to take a lot more space than is required.
2) When storing dollar amounts in a DECIMAL column, DEMIMAL(10,2) means 10 significant digits -- two of which can be to the right of the decimal. Correct?
3) When storing text in a VARCHAR field, is the portion in the parentheses the number of chars that can be stored? Or the number of bytes allotted to the field?
1) When a row is inserted, does each column automatically take the maximum amount of space that was allotted to it? Or does it only take as much space needed for the data that was actually stored? I ask because I want to make sure that I use a data type that is large enough to store what it needs but I don't want it to take a lot more space than is required.
2) When storing dollar amounts in a DECIMAL column, DEMIMAL(10,2) means 10 significant digits -- two of which can be to the right of the decimal. Correct?
3) When storing text in a VARCHAR field, is the portion in the parentheses the number of chars that can be stored? Or the number of bytes allotted to the field?