You are creating a table to store customer data. The AccountNumber column uses values that always consist of one letter and four digits. Which data type should you use for the AccountNumber column?
A. CHAR
B. BYTE
C. DOUBLE
D. SMALLINT
3 Comments on “Which data type should you use for the AccountNumber column?”
Paulsays:
letters AND digits .Answer is varchar
1
1
Kylesays:
Char can be alpha-numeric.
VarChar is short for Variable Character, or that the character length can vary. Where if the length is or will be the exact same, then Char is ideal. Where the character length can vary, then Varchar is ideal.
Variable does not exclusively mean a number.
6
0
Svensays:
Either CHAR or VARCHAR can be correct. But remember you are not answering a question, you are taking a test. And the purpose of a test is to give the answer they want, not necessarily the right answer.
So, which is the answer they want? They are asking about, “one letter and four digits”. The “one letter” means that BYTE, DOUBLE, and SMALLINT are all wrong. So, CHAR is the answer they want.
It’s not a perfect answer, but remember, the purpose of a test is to pass the test!
letters AND digits .Answer is varchar
1
1
Char can be alpha-numeric.
VarChar is short for Variable Character, or that the character length can vary. Where if the length is or will be the exact same, then Char is ideal. Where the character length can vary, then Varchar is ideal.
Variable does not exclusively mean a number.
6
0
Either CHAR or VARCHAR can be correct. But remember you are not answering a question, you are taking a test. And the purpose of a test is to give the answer they want, not necessarily the right answer.
So, which is the answer they want? They are asking about, “one letter and four digits”. The “one letter” means that BYTE, DOUBLE, and SMALLINT are all wrong. So, CHAR is the answer they want.
It’s not a perfect answer, but remember, the purpose of a test is to pass the test!
6
1