Jump to content

Normalization for a small personal pproject

- - - - -

  • Please log in to reply
10 replies to this topic

#1
seristee

seristee

    Newbie

  • Members
  • PipPip
  • 17 posts
can someone who knows normalization please help me normalize this table. i am working on a small java based program and need this table normalized

[ATTACH]4478[/ATTACH]
attached is a copy of the table i need normalized
#thanks for your support

Attached Files

  • Attached File  1975.pdf   53.73K   43 downloads


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Let's start with a different question: why is it NOT normalized?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
seristee

seristee

    Newbie

  • Members
  • PipPip
  • 17 posts
ok i was told that if i want to add say multiple pdf files to the floorplan field without the second file overwriting the first i would have to normalize it to 3nf

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Nothing in your table indicates you would want to do such a thing, however. This backs us up to another question: what do you want to store in your database?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
seristee

seristee

    Newbie

  • Members
  • PipPip
  • 17 posts
reference id<varchar> primarykey eg 1989-001
firstname<varchar>
lastname<varchar>
propertytitle<varchar>
address<varchar>
district<varchar>
floorplan<blob>
reportsubmitted<blob>
businesstitle<varchar>
review<date>
request<blob>

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Unfortunately, a DDL doesn't tell me your intentions. I look at way to many databases with poor documentation.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#7
seristee

seristee

    Newbie

  • Members
  • PipPip
  • 17 posts
i just want to continually update the database with the latest entries not overwriting the previous ones. say for example i have a reference id of 1989-001 i want to add another floorplan and report but i already have that data saved on the database. how can i add a new floor plan pdf without overwriting the previous one and say when i query the table i can get both the floor plans show returned ...
thanx for your responses.....

#8
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Here's what you need to do:
Step 1) identify invariant data, the stuff that requires no history or recorded changes. That goes in your main table with an appropriate primary key.
Step 2) identify the FIRST block of data that does require history. Use the primary key from Step 1 as your foreign key, and add an element (date/time?) to finish of the primary key for this table.
Step 3) repeat step 2 as needed, realizing that any table you've defined so far could be a "parent table" for your new table.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#9
seristee

seristee

    Newbie

  • Members
  • PipPip
  • 17 posts
oh k i think i understand say for example floorplan is a blob i can create a new table called plans create a field called planid and another field say called submittedplan. i can do that for all three blobs to start of with is taht what you talking about ??
thanks in advance....

#10
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Exactly, but I'd also add a date field so you know when each plan was submitted and can easily retrieve the newest one.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#11
seristee

seristee

    Newbie

  • Members
  • PipPip
  • 17 posts
yes what i did instead of the reference number being a date and number i separated them created a date field and a referencenumber field.i tried it in mysql but the tables dont automatically update. the parent table being reports. when i add new entries into it the parent table the rest of the tables stay the same nothing is updated.....

i have attached a table that i created using mysql workbench can someone please let me know wehre im goin wrong and how can i get all teh tables to update when i enter inforamtion into the fields


thanks for your response......

Attached Files


Edited by seristee, 08 January 2012 - 03:59 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users