N
needinghelp
Guest
This is being added to a dabase I am working on kind of as an after though. I live in the US and am working for a political lobbyist. The database contains a table that has lots of personal information on our clients, such as name address and phone number. What we would like to accomplish is to be able to enter the persons county and of residence and find out their State Senator and State Legislature. Because the Senate and Legislative districts that devide the state don't follow county lines but are instead based on population it is possible for one county to have multiple senate or legislature districts or for one senate or legislative distirct to inclue multiple counties. Note that the district lines are also not the same for the senate and legislature. For this purpose I have created five table with following fields:
Counties
--------
County
Senate Districts
----------------
County
District
Senate
-------
District
Senator ID
Legislative Districts
---------------------
County
District
Legislature
-----------
District
Legilatiure ID
The county field in the Counties table relates to the County fields in the Senate District and Legistative District Tables. The District Fields also relate to each other within the appropriate branch. The County field in the Counties table also relates to the County Field in my Personal Data table mentioned earlier. The Senator ID and Legislature ID fields relate back to the Personal ID field in the Personal Data Table
Now that I've provided the background information here comes the question part.
a) have I set this up in a way that makes sense or is there a better way to do it.
b) how can I query this setup so that I can query a counry and it will list the Senate District number(s) and appropriat Senator(s) and the Legistalure District number(s) as well as appropriate Legistature(s) without having information repeated. The way I have my query currently set up I get:
Senate Senator Legistlature Legislature
District District
---------------------------------------------
1 Smith 1 Jones
1 Smith 2 Fredrick
2 Adams 1 Jones
2 Adams 1 Fredrick
and so on.
Thanks for any help you can provide.
Counties
--------
County
Senate Districts
----------------
County
District
Senate
-------
District
Senator ID
Legislative Districts
---------------------
County
District
Legislature
-----------
District
Legilatiure ID
The county field in the Counties table relates to the County fields in the Senate District and Legistative District Tables. The District Fields also relate to each other within the appropriate branch. The County field in the Counties table also relates to the County Field in my Personal Data table mentioned earlier. The Senator ID and Legislature ID fields relate back to the Personal ID field in the Personal Data Table
Now that I've provided the background information here comes the question part.
a) have I set this up in a way that makes sense or is there a better way to do it.
b) how can I query this setup so that I can query a counry and it will list the Senate District number(s) and appropriat Senator(s) and the Legistalure District number(s) as well as appropriate Legistature(s) without having information repeated. The way I have my query currently set up I get:
Senate Senator Legistlature Legislature
District District
---------------------------------------------
1 Smith 1 Jones
1 Smith 2 Fredrick
2 Adams 1 Jones
2 Adams 1 Fredrick
and so on.
Thanks for any help you can provide.