MySQL: Add School ID as Second Primary Key in mis_exam_question_type Table
To add "school_id" as a second primary key in the "mis_exam_question_type" table in MySQL, you can use the following SQL query: \n\nsql\nALTER TABLE mis_exam_question_type ADD PRIMARY KEY (question_type_id, school_id);\n\n\nThis query adds a composite primary key consisting of both "question_type_id" and "school_id" columns to the table. This ensures that each combination of question type and school is unique, enhancing data integrity and preventing duplicate entries across different schools.
AI 优化版
原文地址:https://www.cveoy.top/t/topic/p1Gr 著作权归作者所有。请勿转载和采集!