Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Posts
    5

    Trying to apply design to real application but struggling.

    Hello,

    I'll begin with a description of my project and then my thoughts about how to go about this.

    I am working on modeling the methane emissions from landfills. The end goal is to allow an individual to see how much methane their site produces given the initial conditions. This application simulates the conditions of every inch of soil on top of the garbage. It collects the condition of each inch every 5 min, over the course of the year. At the end of the simulating, the user needs to be able to recall the data for any inch. The data is too much to store in memory and a database would be quick to retrieve the requested data. The good part about this is that once the user exits the program, they no longer need the database, so there is no need to store multiple sites. I actually plan to delete the database when the program closes.

    So as a whole, the database will have a maximum of 10 covers. Each cover will have a maximum of 120 nodes. The data for the nodes is output every 5 min over the course of 365 days. The data recorded at those intervals consists of about 20 different variables.

    So I'm struggling a bit with how to organize this efficiently. This is my idea for the relationships so far....
    Cover to Node (one to many)
    Node to Day (one to many)
    Day to Data(one to one maybe? All the data for one day. 20 variables recorded roughly 24*60/5 [288] times per day )

    So following the above, Table 1 would contain columns:
    COVER_ID, COVER_NAME, NUMBER_OF_NODES

    Then I'm a bit confused where to go from there. I can visualize how this would work if I were to be looking at it like folders. Say I wanted data for Cover 2, Node 36, Day 15, Methane.
    I would first open up the database folder,
    then the Cover 2 folder,
    then the Node 36 folder,
    then the Day 15 folder.
    In the day 15 folder, there would be a table with the
    following columns: TimeOfDay, temperature, oxygen,
    methane, water, ect...

    How do I go from my folder visual above, to a database? I've been working through some tutorials but nothing similar enough to what I'm looking for.

    Any help is greatly appreciated.

  2. #2
    Join Date
    Mar 2009
    Posts
    5
    Still trying.

    Laid it out in one big table to start with some sample data:
    C = Cover
    N = Node
    D = Day
    T = Time
    MT = Methane
    OX = Oxygen
    TEM = Temperature
    DEN = Density

    C, N, D, T, MT, OX, TEM, DEN
    1, 1, 1, .1, .34, .56, 15.2, 1.3
    1, 1, 1, .2, .35, .57, 15.1, 1.3
    1, 1, 1, .3, .36, .58, 15.0, 1.31
    1, 2, 1, .1, .25, .48, 13.2, 1.45
    1, 2, 1, .2, .26, .49, 13.1, 1.45
    1, 2, 1, .3, .27, .50, 13.0, 1.46
    2, 1, 1, .1, .34, .56, 15.2, 1.3
    2, 1, 1, .2, .35, .57, 15.1, 1.3
    2, 1, 1, .3, .36, .58, 15.0, 1.31
    2, 2, 1, .1, .25, .48, 13.2, 1.45
    2, 2, 1, .2, .26, .49, 13.1, 1.45
    2, 2, 1, .3, .27, .50, 13.0, 1.46
    1, 1, 2, .1, .34, .56, 15.2, 1.3
    1, 1, 2, .2, .35, .57, 15.1, 1.3
    1, 1, 2, .3, .36, .58, 15.0, 1.31
    1, 2, 2, .1, .25, .48, 13.2, 1.45
    1, 2, 2, .2, .26, .49, 13.1, 1.45
    1, 2, 2, .3, .27, .50, 13.0, 1.46

    Do I need more than one table? Do I just need to make my key the combination of the first 4 columns?

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by supermancc0386 View Post
    Do I need more than one table? Do I just need to make my key the combination of the first 4 columns?
    no and yes, respectively
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •