3 ms·
Naming conventions are pretty controversial I think. The databases I deal with are mostly for storing time series data taken from measurement instruments (i.e
by bigger_cheese 10y ago
Naming conventions are pretty controversial I think.
The databases I deal with are mostly for storing time series data taken from measurement instruments (i.e Load Cells, Thermocouples, Flow transmitters, Pressure gauges etc). We seem to use prefixes to distinguish columns i.e.
MS_ (Mass in Tonnes, MS_KG_ etc. Is used If not stored as Tonnes)
VL_ (volume, in cubic meters)
RT_FL_ (is Flow rate in normal cubic meters per hour)
TP_ (is temperature in degrees Celsius)
PR_ (is gauge pressure in KPa)
I've seem some databases which didn't use a prefix convention and in my experience it was a real nightmare trying to keep track of units etc.
There is an ISO standard for naming conventions ISO:11179 - My work's databases are (apparently) configured based on this but I'm sure the DBA's extended it in a bunch of ways.
- Pxtl 10y agoI tend to prefer English suffixes and camelcase rather than Hungarian prefixes and underscores. Like, for a steel coil, InnerDiameterMM, MassTonnes, GaugeMM, etc. I prefer to leave abbreviations for cases where it's obvious even to non-experts, like mm for millimeters.
- bigger_cheese 10y agoMy only issue with that is you'd wind up with some very long column names. Using prefixes you can encode a lot of information in a relatively short ID. Which may or may not be useful. As you mentioned though the downside is it requires some domain knowledge to decode. A lot of our columns are in a form like this: TP_TSC_HEX1_XXXXX (where XXXX is some ID usually from scada system) I can see from the name this is a temperature corresponding to thermocouple id: XXXX in TSC Heat exchanger 1. Edit: I should also mention some programming languages (not sql) have a language feature for specifying named ranges (I think it is called lazy evaluation) which tends to favor prefixed names over suffixed - I.e x1,x2,...,xn to iterate over the prefixed range. We use SAS heavily at my work which supports using this syntax, which probably influenced the design of our DB tables.