Which data type should you use for the AccountNumber column?

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?

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



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Paul

Paul

letters AND digits .Answer is varchar

Kyle

Kyle

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.

Sven

Sven

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!