Ok, I'm going to toss out an example of what I'm trying to do with US states and counties, but I'm not looking for a module to handle them... It's just an example.
Assume I have two content types, the US State and US County content types. So now I have some nodes of US State (alabama, alaska, etc) that have some fields, like maybe population size, square feet of territory, etc. Now I have counties, so I've got some N counties that belong to alabama, some for alaska, etc., each as its own node.
How can I make a US County node know what US State node it belongs to? How can I make US State nodes know what US County nodes belong to them? For like querying in a view or whatever, basically the functionality of foreign keys in a SQL table. This seems like it would be very simple and obvious to do, but I must be missing it.
Remember, this is just example data types, I'm not really working with US States and US Counties, so I don't want some specific module for them, just the idea of how to setup content types and the like to have foreign keys.
And if anyone knows, how efficient is this? If I'm dealing with millions or maybe billions of nodes with some hierarchy of relations, how well can drupal query this stuff with joining linked data from multiple content types based on these "foreign keys"? Is it 10x slower than mysql tables with foreign keys, faster than that?
edit: Using Drupal 7. Maybe this will make things clearer: I've tried making a taxonomy vocabulary or whatever, but I don't see how to specify relations between nodes. I can say a US County is under US State, but how can I say "Baldwin County" is in "Alabama"? Where do I put that data in?