The Artima Developer Community
Sponsored Link

Design Forum
Help in normalization of database

1 reply on 1 page. Most recent reply: Nov 13, 2006 9:01 PM by Charles Hammond

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Irshad Jamal

Posts: 1
Nickname: ijamal
Registered: Jun, 2006

Help in normalization of database Posted: Jun 12, 2006 2:33 AM
Reply to this message Reply
Advertisement
Dear Forum,

I am designing a projects database that requires the following information to be collected. I would appreciate any feedback on this.

1) Project_Sector (Agriculture, Water Supply, Energy)
2) Sub_Sector(Livestock or Crop, Drinking or Irrigation, Alternative or Mini Hydro)
3) Sub_Project# (Every project has a unique number like KHJ-02-JAP-EDU-042)
4) Sub_Project_Title
5)Name of Donor
6)Province Name where project was implemented
7)District name where project was implemented
8)Sub_District where project was implemented
9) Village name where project was implemented
10)Number of beneficiaries
11)Number of women beneficiaries
11)Start_Date of project
12)End date of project
13)Budget_USD
14)Brief description of the project


I normalized the database my breaking it into 3 tables;

Project Table:

Project_Sector_ID (PK)
Project_Sector

Sub-ProjectTable:

Sub_Sector_ID + Project_Sector_ID (Composite primary key)
Sub_Project_Num
Sub_Project_Title
Brief_Project_Desc
Beneficiaries
Women_B eneficiaries
Start_Date
End_Date
Budget_USD

Sub-Project-Location Table:

Sub_Sector_ID + Project_Sector_ID (Composite primary key)
Province_ID
District_ID
Sub_District_ID
Village_ID

In addition to the above tables, I have the following look-up tables:

1)Project_Sector_List:

Project_Sector_ID: 1
Project_Sector_Name: Water Supply


2)Sub_Sector_List:

Sub_Sector_ID: 1
Sub_Sector_Name: Drinking Water


3)Donor_List:

Donor_ID: 1
Donor_Name: European Union

4)Province_List:

Province_ID: 1
Province_Name: Sughd

5)Distrct_List:

District_ID: 1
District_Name: Ayni

6)Sub_District_List:

Sub_District_ID: 1
Sub_District_Name: Baljuvon

7)Village_List:

Village_ID: 1
Village_Name: Shaartuz


The relationships are as follows:

One project has many sub projects (1-m)

One subproject can be implemented in many locations (1-m)


Thanks in advance.

Irshad


Charles Hammond

Posts: 4
Nickname: ceh4702
Registered: Dec, 2005

Re: Help in normalization of database Posted: Nov 13, 2006 9:01 PM
Reply to this message Reply
1) Project_Sector (Agriculture, Water Supply, Energy)
2) Sub_Sector(Livestock or Crop, Drinking or Irrigation, Alternative or Mini Hydro)
3) Sub_Project# (Every project has a unique number like KHJ-02-JAP-EDU-042)
4) Sub_Project_Title

With this construct

1,2,& 3 describe a unique object. 4 also describes the object.

There is some thought that says these items should not be a unique key. If you erroneously use one and need to change it it requires everywhere that the key is present to be changed to correct it. In many instances a unique system created key is better. In this case the key would be very long perhaps and it a created key might work better.

Why is the sub-project key so complicated and long? does it have the Project sector and Sub_sector in it? It it does it may be the primary key??

Also projects like Agriculture and sectors could be a code also along need to be a code with a code lookup table. If you spell it out then it is not a valid key because it can be mispelled.

These are my random thoughts.

Flat View: This topic has 1 reply on 1 page
Topic: sancutary ERD diagram Previous Topic   Next Topic Topic: software architecture

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use