You can't enter them into your system, since Primary Keys can't be NULL. The value must not change throughout the row's lifetime.Īnd then, you find there are some people who don't even have passports. Other systems keep using the old passport numbers, so they now point to ghost people. Whenever someone's passport expires, they get a new one. Then, a few years later, you find out an ugly truth: the entire country is facing an identity crisis. You know passport numbers are unique, so you feel good and implement this system. You figure that's all you need since the passport has the address and everything else. You choose the passport Number as the Primary Key - the identity for everyone. So, you create this database with everything about them: First Name Imagine you're the government, and you want to identify each one of your citizens digitally. And that's exactly why we need primary keys: they resolve the crisis. When creating a database, everything is in an identity crisis. ![]() ![]() You may think Luke is the only one with an identity crisis, but that's not true. We'll start with how to choose a Primary Key, fight an identity crisis, and then finish with code samples for creating a Primary Key in a database. Luke, the great Jedi Master, begins unsure - "Who am I?" - and how could I be anyone important? It takes Yoda, the one with the Force, to teach him how to harness his powers. ![]() Every great story starts with an identity crisis.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |