Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How is name and city a key for a restaurant? There are a dozen of mcdonalds in my city.


That combination of columns being a candidate key depends on the world or domain that your dataset is modeling. In this example, I think it was a list of the top 50 restaurants in the world and so it would make a fine key. But if that database was ever expanded then definitely you would run into collision issues.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: