Hi, im having trouble with the design of a Inspections Log (building permits) data base:
so ok,
Each City (tblCity) can have many Jobs
Each Job (tblJob) can have many Permits
Each Permit (tblPermit) can have many Inspections (tblInspections)
a Inspection has a InspectionType (ie: Partial, Final, etc)
Some Cities (like 20% of them) use a code system to schedule inspections by phone (ie: 001 for Final, 002 for Partial).
These codes are different between cities (ie: for Miami Beach: 101 for Final, City of Miami: 2001 for Final)
90% of the inspection types are the same for every city (ie: every city has a "Final", "Rough", etc inspections)
Some cities have more inspection types than others (ie:City of Miami has a "Partial Rough" inspections but City of Aventura doesn't)
So here is the thing,
I have 2 ideas of how to do this
The first one is would be to have a table tblInspectionType where it will be stored all the InspectionTypes and codes for each city (and of course the city ID)
but in doing this i will have lots of redundant data like 50 records with "Final" or "Rough" and lots of nulls in the Field for the codes
The second idea is to have 2 tables tblInspectionType and tblInspectionCode where one inspectionType has many inspectionCodes but i will still have the nulls since there are cities with no codes
so theres a third idea
create a field in tblInspection for the Code
store the tblInspectionType and tblINspectionCodes IDs on the inspection table so when theres no Inspection Code i will leave that new field blank but again i will have nulls and now and some kind of redundancy since the InspectionCode is stored on tblInspectionType
now that i read the null theread im scared, plz help
so ok,
Each City (tblCity) can have many Jobs
Each Job (tblJob) can have many Permits
Each Permit (tblPermit) can have many Inspections (tblInspections)
a Inspection has a InspectionType (ie: Partial, Final, etc)
Some Cities (like 20% of them) use a code system to schedule inspections by phone (ie: 001 for Final, 002 for Partial).
These codes are different between cities (ie: for Miami Beach: 101 for Final, City of Miami: 2001 for Final)
90% of the inspection types are the same for every city (ie: every city has a "Final", "Rough", etc inspections)
Some cities have more inspection types than others (ie:City of Miami has a "Partial Rough" inspections but City of Aventura doesn't)
So here is the thing,
I have 2 ideas of how to do this
The first one is would be to have a table tblInspectionType where it will be stored all the InspectionTypes and codes for each city (and of course the city ID)
but in doing this i will have lots of redundant data like 50 records with "Final" or "Rough" and lots of nulls in the Field for the codes
The second idea is to have 2 tables tblInspectionType and tblInspectionCode where one inspectionType has many inspectionCodes but i will still have the nulls since there are cities with no codes
so theres a third idea
create a field in tblInspection for the Code
store the tblInspectionType and tblINspectionCodes IDs on the inspection table so when theres no Inspection Code i will leave that new field blank but again i will have nulls and now and some kind of redundancy since the InspectionCode is stored on tblInspectionType
now that i read the null theread im scared, plz help