In other words, I have a forum with two tables, one with the primary thread and the other with the reply. The primary key is the only field in the table that recognizes records, it is generally the post ID, which is reflected in the access time, for example, thread. PHP? Id = 1 indicates that I want to access a post whose ID is 1 ~ Let's talk about the foreign key. When we delete a post, we need to perform another operation, that is, to delete all replies. Normally, we need to perform two delete operations (thread and reply). In this case, if a foreign key exists, for example, create a primary key (ID) pointing to the thread table in the reply table) (the Field bound to this foreign key must be the ID of the corresponding post), and specify the response to delete. When you delete the thread, mySQL will help you delete all replies from this post in the reply table, instead of manually executing the delete operation in the reply table ~ In the preceding example, the foreign key of the reply table points to the primary key of the thread table ~~