Recently, I saw a video on the Internet, which introduced the settings of the main key,
The video says that it is best not to set the meaningful string as the main key, and the setting of the main key must not have meaning.
Why is it better not to set a string with meaning as a primary key?
1: In the design of the table, there are generally primary keys and foreign keys, if the primary key is modified, other foreign keys will also be modified as needed.
2: If you use the primary key to find data, and then the primary key is a meaningful character, it is easy to leak information.
Therefore, it is best to set the primary key to some meaningless characters, such as: 1, 2, 3.....
|