Need database design advice

From: Mr m?ll (salviakrydda_at_yahoo.se)
Date: 06/06/04

  • Next message: Michael C: "Re: Need database design advice"
    Date: 6 Jun 2004 16:36:58 -0700
    
    

    i everyone!
    I am quite new to designing databases and have a problem. It is a bit
    tricky to explain...I would really appriciate help from anyone
    experienced
    here:)

    I'm makeing a program using MS SQL Server (actually MSDE) and want to
    keep track of several measurement instruments. The instruments can
    measure
    data of different data types, which are reported to the DB-prgram:

    Instrument1: temp(int), wind vel.(int)
    Instrument2: water%(float), userinput(varchar(20)), camera
    snapshot(Image)
    ...and so on

    Sometimes the measurements from the different instruments should be
    considered
    as one measurement, like for example you should be able to find the
    measurement,M,
    where the temp was "55" and the water% was "87.7".

    Now to the question:
    Should I use one big table holding every value that can be measured by
    any instrument.This would solve alot of problems, but most of the time
    I'll have alot of empty columns.

    |----------------------
    |AllValues |
    -----------------------
    |measurementID |
    |value1forInstrument1 |
    |value2forInstrument1 |
    |value1forInstrument2 |
    |value2forInstrument2 |
    |value3forInstrument3 |
    | ... |
    -----------------------

    ...or should I have one separate table for every instrument?
    This sounds nicer but in that case I get some problems:

    I have to name the tables names like "Instr1Table", "Instr2Table". Say
    that I then want to get all values from measurement M. To be able to
    go through all tables I have to have a list of all my tables. The only
    solution I can come up with is have a table with the strings
    "Instr1Table", "Instr2Table" and loop through that list and make a
    SQL-query of those strings.

    PS
    There are 2-5 instruments, wich measures 5-10 different values
    The number of instrument will probably rise in the future. So this
    means I either have to extend my AllValues-table or add another
    "InstrXTable"-table
    DS

    Very greatful for answers, thanks in advance, Möll


  • Next message: Michael C: "Re: Need database design advice"

    Relevant Pages

    • Re: Python reliability
      ... measurement instruments thrgough the network. ... then an alarm is set. ... A false alarm is costly, ...
      (comp.lang.python)
    • Re: Resolving the fine line spectras of LCD spectra
      ... that the measurement by high and low resolution ... for the conversion of the spectra into XYZ values. ... narrow large peaks are ... Better instruments - more accurate results. ...
      (sci.engr.color)
    • Re: Need database design advice
      ... Usually you'll set up separate tables that will look something like this: ... TABLE: Instruments ... Measurements table with a field specifying which type of measurement, ... SELECT * FROM Instruments i INNER JOIN TemperatureMeasurements t ON ...
      (microsoft.public.sqlserver)
    • Need database design advice
      ... keep track of several measurement instruments. ... I'll have alot of empty columns. ... SQL-query of those strings. ...
      (microsoft.public.access.tablesdbdesign)
    • Re: Proms
      ... old instruments were found in Greece. ... guitar to Spain as being connected with its appetence in Persia and India at ... The Sitar has no plausibility as the origin of the Kithara. ... does not even have 30 strings. ...
      (rec.arts.drwho)

    Loading