Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Database Normalization Problem

Status
Not open for further replies.

antzzz

Programmer
Mar 9, 2001
85
AE
Hi, I have one table containing details of records that have been read from a textfile. The fields are similar as below:

1) Record type
2) Record details
3) Filename
4) Download Timestamp

I'm using the same table to store records read from other files but different dates. My problem is that for example if I read 1000 records from a file, all these records will have the same Filename and Download Timestamp which looks redundant. Can anyone help me normalize this table? If I remove the timestamp and file info from the table, how will I differentiate 2 records of the same type but with different timestamps? Thanks!:)
 
You will have 2 tables with this structure:
1) Record type
2) Record details
3) FileTimeID

1) FileTimeID
2) Filename
3) Download Timestamp
-----------------------------
or three tables like this:

1) Record type
2) Record details
3) FilenameID
4) TimestampID

1) FilenameID
2) Filename

1) Timestamp ID
2) Download Timestamp
----------------------------------------------
And you keep the tables linked through IDs fields.
But I don't advise you to do that. Even though your data will be normalized, you will spend a lot of time and thinking managing the relations. If you are using SQL server to store the data and you rely on JOIN commands you should know that putting more that 4 JOIN in a query badly affects the query performance.

Hope this helps somehow,s-)
Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 

What identifies a unique identity? What does the column "Record Details" contain? If it is a single data item, then it must be unique and would become the primary key. If, as the column name indicates, it contains multiple attributes, these should each be placed in a separate column with one or more of the columns identifying unique records. Terry
------------------------------------
Blessed is the man who, having nothing to say, abstains from giving us worthy evidence of the fact. -George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top