Tag Info

New answers tagged

0

What happens when your customer FOO, Inc. changes its name (gets bought out by another company like Northwest Airlines which is now Delta, or like Accenture which used to be Anderson Consulting)? You have to change all instances of "FOOINC" to something else, and if that's your primary key and there are other tables that have foreign key references to it, ...


0

You have to choose one of the terminal stations as origin and store the distances from origin to the each station on the route: +--------------+----------------------+ | Station Name | Distance from origin | +--------------+----------------------+ | Station A | 0 | | Station B | 10 | | Station C | ...


3

Unfortunately, you can't even derive the country from the postal code. For example, the postal code 50170 can be found in 10 different countries. And some countries don't have postal codes. And some countries contain other countries, not provinces (UK contains England). For autofill, I would suggest using HTML5 geolocation or IP address geolocation to ...


0

Your relationships should be based on the data itself, not necessarily what a diagram would look like. In your example of states, if you have a relationship (foreign key) to the states table, that would limit the values in the state column to the values in the states table. It would be perfectly okay to have a value in the state column of 'PA' for ...


1

"reside in the same state" is a relationship. Whether it's a meaningful relationship or not depends on the subject under discussion. If it's a database about political affiliations, it might be very meaningful. For most applications, it would be completely meaningless. Inferring meaning from the table design is a little like "data forensics" or reverse ...


0

No, you should not have multiple State tables. Having a single table with relationships to the others is the right way to approach this. The perception that this somehow implies that the other tables are linked, other than they share a State, is purely in your head - such an interpretation would not be common practice. You should distinguish between your ...


0

Consider a location on Earth. I can find it with (longitude, latitude) pairs or with the HTM (Hierarchical Triangular Mesh) code. Since they both measure the same data. This is a physical fact, which we can measure with a cell phone; it translates a grid number into [longitude, latitude] for you), they must both be either atomic or compound in your model. ...



Top 50 recent answers are included