wvandenberg
Technical User
I am designing a db with the specs outlined below. I am not trained in database development and have taken over this existing db and then modified it. I am hoping for some advice on my design. I would like to develop something that is “normalized”.
The system I am designing will be used to store water quality data collected at various sites on a number of rivers under various projects. Samples are collected by my company and then the laboratory sends us the analysis results in an Excel file. We also receive Excel files with data collected by other agencies. I will need to import all data we receive into this db. The system will also have to export stored data based on user selected parameters (eg. site name, hydrologic unit, sample name etc.).
tblAnalysis_Methods: Stores all analyte analysis methods
pkAnalysis_Method_ID
Analysis_Method_Description
tblAnalysis_Methods tblAnalytes
pkAnalysis_Method_ID (1) -> (M) fkAnalysis_Method_ID
Attributes: Enforced
------------------------------------------
tblAnalytes: Stores All iterations of analyte names from various analysis sources
pkAnalyte_ID
fkLab_Group_ID
fkReporting_Units_ID
Analyte_Name
Detection_Limit
fkAnalysis_Method_ID
tblLab_Groups tblAnalytes
pkLab_Group_ID (1) -> (M) fkLab_Group_ID
Attributes: Enforced
tblAnalysis_Methods tblAnalytes
pkAnalysis_Method_ID (1) -> (M) fkAnalysis_Method_ID
Attributes: Enforced
tblAnalytes tblGALGrouped_Analytes
pkAnalyte_ID (1) -> (M) pkfkAnalyte_ID
Attributes: Enforced
tblAnalytes tblResults
pkAnalyte_ID (1) -> (M) pkfkAnalyte_ID
Attributes: Enforced
tblReporting_Units tblAnalytes
pkReporting_Units_ID (1) -> (M) fkReporting_Units_ID
Attributes: Enforced
------------------------------------------
tblGAL_Groups: Grouping for analytes to be exported
pkGAL_Group_ID
GAL_Group_Name
tblGAL_Groups tblGALGrouped_Analytes
pkGAL_Group_ID (1) -> (M) pkfkGAL_Group_ID
Attributes: Enforced
------------------------------------------
tblGALGrouped_Analytes: Stores select groups and assigned analytes in specified order
pkfkGAL_Group_ID
GG_Order
pkfkAnalyte_ID
GA_Order
tblAnalytes tblGALGrouped_Analytes
pkAnalyte_ID (1) -> (M) pkfkAnalyte_ID
Attributes: Enforced
tblGAL_Groups tblGALGrouped_Analytes
pkGAL_Group_ID (1) -> (M) pkfkGAL_Group_ID
Attributes: Enforced
------------------------------------------
tblHydrologicUnits: Self-referencing table containing Basins, Watersheds and Rivers
Unit_ID
Unit_Name
Unit_Type
Parent_Unit_ID
I am still trying to determine relationship between tblHydrologicUnits and tblSites
------------------------------------------
tblIDLocations: Keeps track of the original location from which the data were acquired
pkIDLoc
IDLoc_Description
tblIDLocations tblSamples
pkIDLoc (1) -> (M) fkIDLoc
Attributes: Enforced
------------------------------------------
tblLab_Groups: All iterations of group names from analysis sources
pkLab_Group_ID
Lab_Group_Description
tblLab_Groups tblAnalytes
pkLab_Group_ID (1) -> (M) fkLab_Group_ID
Attributes: Enforced
------------------------------------------
tblOrganizations: Organizations responsible for initiating sampling programs
pkOrganization_ID
Organization_Short
Organization_Name
tblOrganizations tblProjects_Programs
pkOrganization_ID (1) -> (M) fkOrganization_ID
Attributes: Enforced
------------------------------------------
tblProjects_Programs: Project numbers, name and purpose
pkProject_Code
Program_Project
fkOrganization_ID
Project_Purpose
tblOrganizations tblProjects_Programs
pkOrganization_ID (1) -> (M) fkOrganization_ID
Attributes: Enforced
tblProjects_Programs tblSamples
pkProject_Code (1) -> (M) fkProject_Code
Attributes: Enforced
------------------------------------------
tblReplicates: Replicate results
pkfkAnalyte_ID
pkfkSample_ID
Sample_Name
Result_Value
Symbol
Qualifier_Code
Outlier
QCFail
Comments
IDLoc
pkfkAltSample_ID
tblResults_Qualifiers tblReplicates
pkQualifier_Code Qualifier_Code
Attributes: Not Enforced
tblSamples tblReplicates
pkSample_ID pkfkSample_ID
Attributes: Not Enforced
tblSamples tblReplicates
pkSample_ID pkfkAltSample_ID
Attributes: Not Enforced
------------------------------------------
tblReporting_Units: List of result reporting units
pkReporting_Units_ID
Reporting_Units_Description
tblReporting_Units tblAnalytes
pkReporting_Units_ID (1) -> (M) fkReporting_Units_ID
Attributes: Enforced
------------------------------------------
tblResults: Numerical results of sample analysis
pkfkAnalyte_ID
pkfkSample_ID
Sample_Name
Result_Value
Symbol
Qualifier_Code
Outlier
QCFail
Comments
IDLoc
tblAnalytes tblResults
pkAnalyte_ID (1) -> (M) pkfkAnalyte_ID
Attributes: Enforced
tblResults_Qualifiers tblResults
pkQualifier_Code Qualifier_Code
Attributes: Not Enforced
tblSamples tblResults
pkSample_ID (1) -> (M) pkfkSample_ID
ttributes: Enforced
------------------------------------------
tblResults_Qualifiers: Codes used to further quantify a result
pkQualifier_Code
Qualifier_Description
tblResults_Qualifiers tblReplicates
pkQualifier_Code Qualifier_Code
Attributes: Not Enforced
tblResults_Qualifiers tblResults
pkQualifier_Code Qualifier_Code
Attributes: Not Enforced
------------------------------------------
tblSample_Types: Sample collection types
pkSample_Type
Sample_Type_Description
tblSample_Types tblSamples
pkSample_Type (1) -> (M) fkSample_Type
Attributes: Enforced
------------------------------------------
tblSamples: Samples collected at Sites
pkSample_ID
fkIDLoc
fkProject_Code
fkSite_ID
Sample_Name
Start_Date
Missing_Time
End_Date
fkSample_Type
Comment
tblIDLocations tblSamples
pkIDLoc (1) -> (M) fkIDLoc
Attributes: Enforced
tblSites tblSamples
pkSite_ID (1) -> (M) fkSite_ID
Attributes: Enforced
tblProjects_Programs tblSamples
pkProject_Code (1) -> (M) fkProject_Code
Attributes: Enforced
tblSample_Types tblSamples
pkSample_Type (1) -> (M) fkSample_Type
Attributes: Enforced
tblSamples tblReplicates
pkSample_ID pkfkSample_ID
Attributes: Not Enforced
tblSamples tblReplicates
pkSample_ID pkfkAltSample_ID
Attributes: Not Enforced
tblSamples tblResults
pkSample_ID (1) -> (M) pkfkSample_ID
Attributes: Enforced
------------------------------------------
tblSites: Site location information
pkSite_ID
Northing
Easting
UTM_Zone
GAL_Site_Name
AENV_Site_Name
RAMP_Site_Name
Industry_Site_Name
Other_Site_Name
Place_Name_Description
tblSites tblSamples
pkSite_ID (1) -> (M) fkSite_ID
Attributes: Enforced
------------------------------------------
tblUnit_Types: Basin, Watershed, River
UnitTypeID
UnitTypeName
tblUnitTypes tblHydrologicUnitsSites
pkUnitTypeID (1) -> (M) fkUnit_Type_ID
Attributes: Enforced
I have two specific questions in addition to general advice anyone can offer.
1. I would like to be able to "link" similar analyte names to a standard analyte group and analyte name. tblAnalytes.Analyte_Name will contain data like:
Mercury (Hg)
LL Mercury
Trace Mercury
Hg DISSOLVED
So, I would like to keep the original data but be able to allow the user to match up the analyte name to a standard list that my company uses. Not all analyte names would match to one in the standard list.
2. I'm not sure how to link tblHydrologicUnits to tblSites. Should I put a foreign key in tblSites to store the lowest child record ID in tblHydrologicUnits? Will this allow me to create a form that will allow users to "drill down" to find a site?
Sorry for the informaiton overload but I hope someone can make some sense of it all. Any advice, criticism etc is greatly appreciated. Thanks.
Wendy
The system I am designing will be used to store water quality data collected at various sites on a number of rivers under various projects. Samples are collected by my company and then the laboratory sends us the analysis results in an Excel file. We also receive Excel files with data collected by other agencies. I will need to import all data we receive into this db. The system will also have to export stored data based on user selected parameters (eg. site name, hydrologic unit, sample name etc.).
tblAnalysis_Methods: Stores all analyte analysis methods
pkAnalysis_Method_ID
Analysis_Method_Description
tblAnalysis_Methods tblAnalytes
pkAnalysis_Method_ID (1) -> (M) fkAnalysis_Method_ID
Attributes: Enforced
------------------------------------------
tblAnalytes: Stores All iterations of analyte names from various analysis sources
pkAnalyte_ID
fkLab_Group_ID
fkReporting_Units_ID
Analyte_Name
Detection_Limit
fkAnalysis_Method_ID
tblLab_Groups tblAnalytes
pkLab_Group_ID (1) -> (M) fkLab_Group_ID
Attributes: Enforced
tblAnalysis_Methods tblAnalytes
pkAnalysis_Method_ID (1) -> (M) fkAnalysis_Method_ID
Attributes: Enforced
tblAnalytes tblGALGrouped_Analytes
pkAnalyte_ID (1) -> (M) pkfkAnalyte_ID
Attributes: Enforced
tblAnalytes tblResults
pkAnalyte_ID (1) -> (M) pkfkAnalyte_ID
Attributes: Enforced
tblReporting_Units tblAnalytes
pkReporting_Units_ID (1) -> (M) fkReporting_Units_ID
Attributes: Enforced
------------------------------------------
tblGAL_Groups: Grouping for analytes to be exported
pkGAL_Group_ID
GAL_Group_Name
tblGAL_Groups tblGALGrouped_Analytes
pkGAL_Group_ID (1) -> (M) pkfkGAL_Group_ID
Attributes: Enforced
------------------------------------------
tblGALGrouped_Analytes: Stores select groups and assigned analytes in specified order
pkfkGAL_Group_ID
GG_Order
pkfkAnalyte_ID
GA_Order
tblAnalytes tblGALGrouped_Analytes
pkAnalyte_ID (1) -> (M) pkfkAnalyte_ID
Attributes: Enforced
tblGAL_Groups tblGALGrouped_Analytes
pkGAL_Group_ID (1) -> (M) pkfkGAL_Group_ID
Attributes: Enforced
------------------------------------------
tblHydrologicUnits: Self-referencing table containing Basins, Watersheds and Rivers
Unit_ID
Unit_Name
Unit_Type
Parent_Unit_ID
I am still trying to determine relationship between tblHydrologicUnits and tblSites
------------------------------------------
tblIDLocations: Keeps track of the original location from which the data were acquired
pkIDLoc
IDLoc_Description
tblIDLocations tblSamples
pkIDLoc (1) -> (M) fkIDLoc
Attributes: Enforced
------------------------------------------
tblLab_Groups: All iterations of group names from analysis sources
pkLab_Group_ID
Lab_Group_Description
tblLab_Groups tblAnalytes
pkLab_Group_ID (1) -> (M) fkLab_Group_ID
Attributes: Enforced
------------------------------------------
tblOrganizations: Organizations responsible for initiating sampling programs
pkOrganization_ID
Organization_Short
Organization_Name
tblOrganizations tblProjects_Programs
pkOrganization_ID (1) -> (M) fkOrganization_ID
Attributes: Enforced
------------------------------------------
tblProjects_Programs: Project numbers, name and purpose
pkProject_Code
Program_Project
fkOrganization_ID
Project_Purpose
tblOrganizations tblProjects_Programs
pkOrganization_ID (1) -> (M) fkOrganization_ID
Attributes: Enforced
tblProjects_Programs tblSamples
pkProject_Code (1) -> (M) fkProject_Code
Attributes: Enforced
------------------------------------------
tblReplicates: Replicate results
pkfkAnalyte_ID
pkfkSample_ID
Sample_Name
Result_Value
Symbol
Qualifier_Code
Outlier
QCFail
Comments
IDLoc
pkfkAltSample_ID
tblResults_Qualifiers tblReplicates
pkQualifier_Code Qualifier_Code
Attributes: Not Enforced
tblSamples tblReplicates
pkSample_ID pkfkSample_ID
Attributes: Not Enforced
tblSamples tblReplicates
pkSample_ID pkfkAltSample_ID
Attributes: Not Enforced
------------------------------------------
tblReporting_Units: List of result reporting units
pkReporting_Units_ID
Reporting_Units_Description
tblReporting_Units tblAnalytes
pkReporting_Units_ID (1) -> (M) fkReporting_Units_ID
Attributes: Enforced
------------------------------------------
tblResults: Numerical results of sample analysis
pkfkAnalyte_ID
pkfkSample_ID
Sample_Name
Result_Value
Symbol
Qualifier_Code
Outlier
QCFail
Comments
IDLoc
tblAnalytes tblResults
pkAnalyte_ID (1) -> (M) pkfkAnalyte_ID
Attributes: Enforced
tblResults_Qualifiers tblResults
pkQualifier_Code Qualifier_Code
Attributes: Not Enforced
tblSamples tblResults
pkSample_ID (1) -> (M) pkfkSample_ID
ttributes: Enforced
------------------------------------------
tblResults_Qualifiers: Codes used to further quantify a result
pkQualifier_Code
Qualifier_Description
tblResults_Qualifiers tblReplicates
pkQualifier_Code Qualifier_Code
Attributes: Not Enforced
tblResults_Qualifiers tblResults
pkQualifier_Code Qualifier_Code
Attributes: Not Enforced
------------------------------------------
tblSample_Types: Sample collection types
pkSample_Type
Sample_Type_Description
tblSample_Types tblSamples
pkSample_Type (1) -> (M) fkSample_Type
Attributes: Enforced
------------------------------------------
tblSamples: Samples collected at Sites
pkSample_ID
fkIDLoc
fkProject_Code
fkSite_ID
Sample_Name
Start_Date
Missing_Time
End_Date
fkSample_Type
Comment
tblIDLocations tblSamples
pkIDLoc (1) -> (M) fkIDLoc
Attributes: Enforced
tblSites tblSamples
pkSite_ID (1) -> (M) fkSite_ID
Attributes: Enforced
tblProjects_Programs tblSamples
pkProject_Code (1) -> (M) fkProject_Code
Attributes: Enforced
tblSample_Types tblSamples
pkSample_Type (1) -> (M) fkSample_Type
Attributes: Enforced
tblSamples tblReplicates
pkSample_ID pkfkSample_ID
Attributes: Not Enforced
tblSamples tblReplicates
pkSample_ID pkfkAltSample_ID
Attributes: Not Enforced
tblSamples tblResults
pkSample_ID (1) -> (M) pkfkSample_ID
Attributes: Enforced
------------------------------------------
tblSites: Site location information
pkSite_ID
Northing
Easting
UTM_Zone
GAL_Site_Name
AENV_Site_Name
RAMP_Site_Name
Industry_Site_Name
Other_Site_Name
Place_Name_Description
tblSites tblSamples
pkSite_ID (1) -> (M) fkSite_ID
Attributes: Enforced
------------------------------------------
tblUnit_Types: Basin, Watershed, River
UnitTypeID
UnitTypeName
tblUnitTypes tblHydrologicUnitsSites
pkUnitTypeID (1) -> (M) fkUnit_Type_ID
Attributes: Enforced
I have two specific questions in addition to general advice anyone can offer.
1. I would like to be able to "link" similar analyte names to a standard analyte group and analyte name. tblAnalytes.Analyte_Name will contain data like:
Mercury (Hg)
LL Mercury
Trace Mercury
Hg DISSOLVED
So, I would like to keep the original data but be able to allow the user to match up the analyte name to a standard list that my company uses. Not all analyte names would match to one in the standard list.
2. I'm not sure how to link tblHydrologicUnits to tblSites. Should I put a foreign key in tblSites to store the lowest child record ID in tblHydrologicUnits? Will this allow me to create a form that will allow users to "drill down" to find a site?
Sorry for the informaiton overload but I hope someone can make some sense of it all. Any advice, criticism etc is greatly appreciated. Thanks.
Wendy