• Chrissy321 (1/26/2011)


    Hello All,

    My partner thinks its ok to send me a data file where they mix numeric and text data in a single column. When I protest they seem to think I am being a difficult.

    Can anyone provide any links that detail the principle that I think they are violating?

    Thanks

    Do you mean that this column can contain a mixture of text and numeric data in a single row, or that the column contain numeric data in some rows and text in others?

    If the former, then provided the algebra defining the file format includes an atomic type which caters for such values, there's nothing wrong (but I don't recall ever seeing anyone produce such an algebra); if there is no such type in the algebra, then what's being violated is the principle of atomicity of attributes. However, I suspect you don't mean that (unless you mean that some of the text is characters like "123456789" in which case you should remember that that too is text, not numeric data, and Grant's post gives the standard example of those characters being part of the text not something not text but numeric).

    If the latter, again it comes down to there being a suitably defined attribute type; this time what is needed is a type some of whose members are numeric things while some are text; if there isn't an appropriate attribute type defined for this column, then it is not possible to express the signature of the relation being represented, so fundametally it's violated the principle of being based on relational algebra.

    But once again don't make the mistake of thinking that a string like "25 " is numeric, it isn't: it's text. Addresses are the classical example again, in a form somewhat different from that referred to by Grant. A house may have a name or a number or a number with an alphabetic qualifer, for example "25", "27A", "27B", "27C" and "Maddingey House" are five adjacent dwellings on the northern side of East Street. It's very common these days to split the house designator from the road name, city name, and county name; for example the information required by the UK post office and most UK financial institutions and mail order companies is the house designator and the Post Code (so house "College View" Post Code "XY12 4EQ" is all the address needed, and the house next door to that is house "78", Post Code "XY12 4EQ"). The house designator column sometimes contains text that looks like a number, and sometimes text that doesn't look like a number, but it's always text not numeric so far as the attribute type is concerned. This of course is a bit of a nightmare for sorting (you could invent a complicated datatype that contains hordes of geographic data in its definition and handles the sorting issues for you when you want to sort into postman's walk order, but mostly people just accept that the order implied by the behaviour of the attribute type is not the same as the order required by the application).

    Tom