Re: Mapping arbitrary number of attributes to DB

From: Cimode <cimode_at_hotmail.com>
Date: 23 Oct 2006 13:55:07 -0700
Message-ID: <1161636907.323130.24440_at_m73g2000cwd.googlegroups.com>


Joshua J. Kugler wrote:

> What I'm trying to do is find a generic way to map these attributes to a DB
> so that I can import and process any data file. I know the kind of design
> I proposed ("flattening" it to one value per row) isn't the best, but right
> now, I'm not sure how else I'd go about it. That's why I asked for ideas.
>
> So, I guess stated another way, forget about those files...how might I go
> about (or where might I read about) mapping an arbitrary number of
> attributes to a database in a clean, efficient way?
>
> Thanks!
Again, online exchange does not help understand the full spectrum of specifications bound to your need. All I can say is that you need to do some reading. Also as any measuring system with a high number of attributes, you will probably need to separate between type of input on measurement (separate discrete values from ranges, numeric values from strings qualifications)...

as I admit hating that you may consider a schema such as

station:

          stationid, station_(attributes)

measurement_type_numeric_values:

          measurement_type_numeric_values_description (type of measurement, thresholds etc....)

---------------------Then you can separate pairs of tables by type of
possible input below two types of measurement :Numeric such as wind speed AND String such {Good, Fair, Bad}

measurement_type_numeric_values#station:

          stationid, measurement_type_numeric_values_description, unitofmeasurement

measurement_numeric_values

          stationid, measurement_type_numeric_values_description, value, measurement_date

measurement_type_string_values#station:

          stationid, measurement_type_string_values_description

measurement_numeric_values

          stationid, measurement_type_numeric_string_description, value, measurement_date

I hope this helps, but I doubt...I encourage you to do some reading onto the books I pointed out...

> Joshua Kugler
> Lead System Admin -- Senior Programmer
> http://www.eeinternet.com
> PGP Key: http://pgp.mit.edu/ ID 0xDB26D7CE
>
> --
> Posted via a free Usenet account from http://www.teranews.com
Received on Mon Oct 23 2006 - 22:55:07 CEST

Original text of this message