MySQL 如何在phpmyadmin上制作复合主键
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22448808/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make composite primary key on phpmyadmin
提问by user3427877
How to make a composite primary key on phpmyadmin. such that student id is combination of year and roll number. sid = 112132 , 11 of year 2011 and 2132 is roll number?? anybody help..
如何在 phpmyadmin 上创建复合主键。这样学生 ID 是年份和卷号的组合。sid = 112132 , 2011 年的 11 和 2132 是卷号?? 任何人帮助..
回答by Junaid
In the "Structure" pane, check the boxes to the left of all field names you want included in the primary key. (For example, in an order items table, you might check "order ID" and "line item number".) Then click "Primary" in the "With selected:" list of operations just below the field names.
在“结构”窗格中,选中要包含在主键中的所有字段名称左侧的框。(例如,在订单项目表中,您可能会选中“订单 ID”和“行项目编号”。)然后在字段名称下方的“With selected:”操作列表中单击“Primary”。
I hope this will help you in adding primary key using phpMyAdmin.
我希望这会帮助您使用 phpMyAdmin 添加主键。