How to deal with State, County, City relations? (for US 50 states) - database

From the 50 states of US, most of them have counties except Louisiana and Alaska.
My tables would look like this
**State_tbl**
State_id
State_name
**County_tbl**
County_id
State_id ->state_tbl
County_name
**City_tbl**
City_id
County_id ->county_tbl
City_name
However, since the two states Alaska and Louisiana don't have counties, I would have problems implementing them. And I also read that there may be cities within a state that don't have a county, or that belong to two counties (don't know if that is true).
What would be the best approach to design the database?
UPDATE More info:
I have an user which would register to serve into specific cities (within a state). When I retrieve data I want to be able to display both the cities that are served, as well as the counties. There would be a Many-to-Many relationship between the user and the cities served, and a one-many relationship between cities and counties.
i.e:
John K - serving in state_A (all counties and cities below belong to state_A)
-cities served: City_A (county_x), City_B (County_Y), City_C (County_Y)
-counties served: County_X, County_Y
Also, would I be able to retrieve a user's info and all the cities and counties served within one query?

Just treat the boroughs and parishes and counties (or any other naming conventions) as the same thing. The USPS treats them the same and the Census Bureau also treats them the same. Most of the government (and nongovernment organizations) in the US that need to generate any kind of report on counties or statistical areas rely on the MSA or CBSA codes which are based on these units, all of which are referred to as counties - even though they may have other local names.
For Alaska, here are all the boroughs:
ANCHORAGE
BETHEL
ALEUTIANS WEST
LAKE AND PENINSULA
KODIAK ISLAND
ALEUTIANS EAST
WADE HAMPTON
DILLINGHAM
KENAI PENINSULA
YUKON KOYUKUK
VALDEZ CORDOVA
BRISTOL BAY
MATANUSKA SUSITNA
NOME
YAKUTAT
FAIRBANKS NORTH STAR
DENALI
NORTH SLOPE
NORTHWEST ARCTIC
SOUTHEAST FAIRBANKS
JUNEAU
HOONAH ANGOON
HAINES
PETERSBURG
SITKA
SKAGWAY
KETCHIKAN GATEWAY
PRINCE OF WALES HYDER
WRANGELL
For Lousiana, here are all the parishes:
JEFFERSON
SAINT CHARLES
SAINT BERNARD
PLAQUEMINES
ST JOHN THE BAPTIST
SAINT JAMES
ORLEANS
LAFOURCHE
ASSUMPTION
SAINT MARY
TERREBONNE
ASCENSION
TANGIPAHOA
SAINT TAMMANY
WASHINGTON
SAINT HELENA
LIVINGSTON
LAFAYETTE
VERMILION
SAINT LANDRY
IBERIA
EVANGELINE
ACADIA
SAINT MARTIN
JEFFERSON DAVIS
CALCASIEU
CAMERON
BEAUREGARD
ALLEN
VERNON
EAST BATON ROUGE
WEST BATON ROUGE
WEST FELICIANA
POINTE COUPEE
IBERVILLE
EAST FELICIANA
BIENVILLE
NATCHITOCHES
CLAIBORNE
CADDO
BOSSIER
WEBSTER
RED RIVER
DE SOTO
SABINE
OUACHITA
RICHLAND
FRANKLIN
MOREHOUSE
UNION
JACKSON
LINCOLN
MADISON
WEST CARROLL
EAST CARROLL
RAPIDES
CONCORDIA
AVOYELLES
CATAHOULA
LA SALLE
TENSAS
WINN
GRANT
CALDWELL

Related

How can I make a U.S. map with cities represented as dots?

I have a list of 50 cities that I want to plot on a map in Stata. The data is in csv format and looks like this:
New York city New York
Los Angeles city California
Chicago city Illinois
Houston city Texas
Phoenix city Arizona
Philadelphia city Pennsylvania
San Antonio city Texas
San Diego city California
Dallas city Texas
How can I get a U.S. map with a dot for each city? I have looked into spmap but not been able to find a solution.

How can I make a Geo Chart display one specific country and its regions in Google Data Studio?

A Geo Chart usually shows entire world.
How to show one country's region and color them according to my data?
Also how can I group my data in a table so Data Studio can actually represent regions of my country?
e.g. I have 3 countries and number of accounts in each country, in what column can I put regional data for my country?
country
account_number
region
russia
324
??
kazakhstan
5785
??
america
2342
??
I have added a report, Data Studio recognizes the country by country code, but from there it's not clear how to highlight regions by numbers:
Google Data Studio Report
One way it can be achieved is by using:
Chart Type: Google Maps
Bubble Location: region
Bubble Colour: country
Metric: metric
Created an Editable Google Sheet with the sample data below with some random values for the metric field as well as adding a few values for the region field:
country
account_number
region
metric
Russia
324
Moscow
54
Russia
325
Saint Petersburg
36
Russia
326
Krasnodar Krai
14
Kazakhstan
5785
Almaty
31
Kazakhstan
5786
Astana
57
Kazakhstan
5787
Kyzylorda
58
United States
2342
New York
28
United States
2343
California
99
United States
2344
Texas
30
Editable Google Data Studio Report as well as a GIF to elaborate:

International equivalents of the SEC's EDGAR (SEDAR in Canada) database?

Are there equivalents of the SEC's EDGAR (filing database) for European companies? Or any other region for that matter? For the UK I've found the "Companies House".
http://www.sedar.com/homepage_en.htm
https://www.sec.gov/edgar/searchedgar/accessing-edgar-data.htm
http://download.companieshouse.gov.uk/en_monthlyaccountsdata.html
I'm searching for (XBRL) filings outside the US, preferably for European entities.
United Kingdom: https://beta.companieshouse.gov.uk/search/companies
Ireland: www.cro.ie
France: www.infogreffe.fr
Germany: https://www.unternehmensregister.de/ureg
Italy: www.registroimprese.it
Switzerland: https://www.zefix.ch/
European Business Register (EBR): http://www.ebr.org/
GLO Filings: www.glofilings.com
So far there is no one single aggregator for EU business data.
But you can get data on the country basis.
In the UK that's Companies House - https://www.gov.uk/government/organisations/companies-house
In France, it's the Registre du commerce et des sociétés https://www.infogreffe.fr/societes/
In Germany, it's the Unternehmensregister https://www.unternehmensregister.de/ureg/?language=de&submitaction=language
For other countries there is a list on the Companies House website: https://www.gov.uk/government/pu...

efficient Db Design with (many to many plus one to manys)

(revised) I have a web app where information will be entered for a user. First and last name as well as 3 Affiliations (primary, secondary, and tertiary) associated with the person. Each affiliation has 3 components (title, department, and university). So for example one record could be for:
User: Bob, Robertson
Affiliation1: Professor, Chemistry, U. Florida
Affiliation2: Director, Amazing Chemistry Institute, U. Florida
Affiliation3: Affiliated Faculty, BioChemistry, Florida Tech.
Also, Title and Department are text input fields but Univ. refers to a specific list of about 3000 university names 'univ_name' which is why it has it's own table. also affiliationOrdinal would be something like (1st, 2nd, 3rd)
Users Affiliation Univ.
======= ============ =========
id_user id_affiliation id_univ
FirstName id_user univ_name
LastName affiliationOrdinal
title
department
id_univ
Thanks Sean for your feedback, I started thinking of this more as a user with multiple addresess type of problem and that has been solved many times over it seems. I picked this one as a reference. Mysql database design for customer multiple addresses and default address. So the above should be a bit closer to workable right?

Relation on a multi-valued field in an Access database

Does someone know how I can put more than one value in one field to make a relation between two different records?
Google translation (from German):
Using multivalued fields
In most systems, DBMS (database management systems), including earlier
versions of Microsoft Access, you can only store a single value in a
field. In Microsoft Office Access 2007, you can also create fields
that contain multiple values​​, such as a list of categories to which
you have assigned a condition. Multivalued fields are used in specific
situations, such as when you use Office Access 2007 to work saved in a
Windows SharePoint Services 3.0 list that contains a field of one of
the field types with multiple values ​​that are available in Windows
data SharePoint Services.
This topic describes how to create and use multivalued fields in
Office Access 2007 and Windows SharePoint Services, how to create
multivalued fields and used, and how to use multivalued fields in a
query.
You can use multi-value Lookup fields in JOIN conditions (via their .Value property), but be aware that if there is such a field on both sides of the join then it will produce a match when any item matches on the joined fields, not when all items match. This may or may not be desirable, depending on the situation.
Case 1: Students with allergies
A school administrator needs to keep track of students with allergies and provide them with a list of meals that they should avoid when eating at the school cafeteria.
[Students]
ID Student Allergies
-- ------- ---------
1 Alice Eggs, Soy
2 Bradley Peanuts
3 Carol
4 Dennis Soy
[Meals]
ID Meal Allergens
-- ------------- ---------
1 Thai stir-fry Peanuts
2 Tofu omlette Eggs, Soy
3 Waffles Eggs
The query
SELECT Students.Student, Students.Allergies, Meals.Meal, Meals.Allergens
FROM Students INNER JOIN Meals ON Students.Allergies.Value = Meals.Allergens.Value;
returns
Student Allergies Meal Allergens
------- --------- ------------- ---------
Alice Eggs, Soy Tofu omlette Eggs, Soy
Alice Eggs, Soy Waffles Eggs
Bradley Peanuts Thai stir-fry Peanuts
Dennis Soy Tofu omlette Eggs, Soy
This is appropriate, since Alice should avoid meals that contain any ingredients to which she is allergic.
Case 2: Hotel requirements
[Travellers]
ID Traveller Requirements
-- --------- -------------------------
1 Gord free WiFi, in-room coffee
[Hotels]
ID Hotel Amenities
-- ------------ ----------------------------
1 Budget Motel free WiFi, in-room coffee
2 Fancy Hotel in-room coffee, room service
The query
SELECT Travellers.Traveller, Travellers.Requirements, Hotels.Hotel, Hotels.Amenities
FROM Hotels INNER JOIN Travellers ON Hotels.Amenities.Value = Travellers.Requirements.Value;
returns
Traveller Requirements Hotel Amenities
--------- ------------------------- ------------ ----------------------------
Gord free WiFi, in-room coffee Budget Motel free WiFi, in-room coffee
Gord free WiFi, in-room coffee Fancy Hotel in-room coffee, room service
The query returns both properties because they both offer in-room coffee. However, Fancy Hotel does not offer free WiFi, so I would prefer not to stay there. In this case the default join behaviour is not desirable (to me).

Resources