Number or character?

From: mike sullivan <sullivan_at_sytex.com>
Date: Thu, 4 Nov 1993 18:53:50 GMT
Message-ID: <Fo8Hcc1w165w_at_sytex.com>


I'm trying to decide whether to make data type for a field a number or a character. An example is:

Table one is an employees name, address and phone #. In each record is a state field. Rather than have the state name spelled out in each record, I'd like to make this state field a foreign key that points to a second table called STATE which contains the state name.

My question is, what data type should I make the foreign key in table one? I know that a number is stored as byte 1 = exponents and sign, and each additional byte contains 2 decimal characters. So, I could make the f. key a number data type which would take up 2 bytes. The other option is to make the f. key a char data type of length 1 (upper and lower case would cover all 50 states) or length 2 just for equal comparison.

If both f. key fields were the same length, is there an advantage in indexing (if both were indexed on this field) and the speed of searching for a char or a number value?

If it matters, this is for DBMS 6.0.36 on Interactive Unix.

---
sullivan_at_sytex.com (mike sullivan)
Access <=> Internet BBS, a public access internet site
Sytex Communications, Arlington VA, 1-703-528-4380
Received on Thu Nov 04 1993 - 19:53:50 CET

Original text of this message