假设有学生表(users)
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('1', '小明');
INSERT INTO `users` VALUES ('2', '小虎');
INSERT INTO `users` VALUES ('3', '小花');
INSERT INTO `users` VALUES ('4', '小花');
INSERT INTO `users` VALUES ('5', '小花');
INSERT INTO `users` VALUES ('6', '小虎');
课程成绩表:
-- ----------------------------
-- Table structure for scores
-- --------------------------