Results 1 to 6 of 6
  1. #1
    igglebop is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    6

    Designing a Dynamic Database

    Not sure if "dynamic database" is the right name for this, but here's the challenge:

    I'm designing a database that will be installed at a variety of facilities. The goal is for each facility to have an easy way to store their daily logs in a single location. The challenge is that each facility collects different data on a daily basis.

    The more efficient way to do it is to design a table for each facility that looks like this example:

    tblDailyLog
    • Date (PK)
    • OperatorName
    • Meter1Reading
    • Meter2Reading
    • FlowRate


    But of course, not every facility will have those data points. So here's what I was thinking instead:

    tblReadingTypes
    • ReadingTypeID (PK)
    • ReadingTypeName


    tblReadings

    • ReadingDate (PK)
    • OperatorName


    tblReadingLog

    • ReadingDate (FK) (CPK)
    • ReadingTypeID (FK) (CPK)
    • Result


    I would then have "Meter 1 Reading", "Meter 2 Reading", and "Flow Rate" as elements in the ReadingTypes table.

    It seems awfully redundant to repeat the ReadingDate foreign key over and over with each reading of each day, but I think it's the best way to give it the flexibility to work at other facilities.

    Any thoughts or comments are appreciated!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    Your first "efficient" layout does not follow the rules of normalization, and I would not go that way even if you only had one location. Your second method does, and that's the way I'd go. It's obviously better for multiple locations, and is even better for one. What would happen if a month from now they got a third meter to read? With your first design, you're making design changes to the table, forms, queries, reports, etc. With your second design, you don't make any design changes. A normalized design is also dynamic.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    igglebop is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    6
    Ah, I hadn't realized that it broke the rules of normalization. So you're saying that, even though there's only one set or readings per date (thus not repeating data), it doesn't meet the 3rd normal form because the Readings group of attributes doesn't inherently relate to the Date attribute. Is this correct?

    I'm fairly new to databases, but it's important to me to learn good design from the get-go.

    Ryan

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    I'm not strong with the actual rules, but I suspect it doesn't meet 1st normal form. What you have I would call repeating groups. I would call each a "reading", and the flaw might be more obvious if you named the fields Reading1, Reading2, Reading3. Here's one link on normalization, and I would interpret your fields as being covered in the discussion on first normal form, specifically figure 7:

    http://www.r937.com/Relational.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    igglebop is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    6
    Thanks for the help!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    No problem, and welcome to the site!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Please Help! Designing a medical database
    By DrJ in forum Database Design
    Replies: 3
    Last Post: 11-10-2011, 01:27 PM
  2. Designing a database for a log
    By neo651 in forum Database Design
    Replies: 3
    Last Post: 10-31-2011, 11:45 AM
  3. Help with designing database
    By nimalp in forum Access
    Replies: 6
    Last Post: 09-15-2010, 10:34 AM
  4. Designing Load Database
    By salisbut in forum Database Design
    Replies: 5
    Last Post: 08-02-2010, 10:41 AM
  5. questions on designing database
    By schultzy in forum Access
    Replies: 1
    Last Post: 07-18-2009, 03:44 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums