/*
 Navicat Premium Data Transfer

 Source Server         : 116.198.196.184
 Source Server Type    : MySQL
 Source Server Version : 50736
 Source Host           : 116.198.196.184:3306
 Source Schema         : g6rk7_18

 Target Server Type    : MySQL
 Target Server Version : 50736
 File Encoding         : 65001

 Date: 18/07/2024 08:56:20
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for class
-- ----------------------------
DROP TABLE IF EXISTS `class`;
CREATE TABLE `class`  (
  `class_id` int(11) NOT NULL AUTO_INCREMENT,
  `class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`class_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of class
-- ----------------------------
INSERT INTO `class` VALUES (1, '1班');
INSERT INTO `class` VALUES (2, '2班');
INSERT INTO `class` VALUES (20, '20班');
INSERT INTO `class` VALUES (30, '30班');

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student`  (
  `eid` int(11) NOT NULL AUTO_INCREMENT,
  `ename` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `sex` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `tel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `class_id` int(11) NULL DEFAULT NULL,
  `age` int(11) NULL DEFAULT NULL,
  `sal` int(2) NULL DEFAULT NULL,
  PRIMARY KEY (`eid`) USING BTREE,
  INDEX `class_id`(`class_id`) USING BTREE,
  CONSTRAINT `student_ibfk_1` FOREIGN KEY (`class_id`) REFERENCES `class` (`class_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of student
-- ----------------------------
INSERT INTO `student` VALUES (1, '小红', '女', '16738192312', 1, 25, 3000);
INSERT INTO `student` VALUES (2, '小蓝', '男', '1786312341230', 30, 10, 1000);
INSERT INTO `student` VALUES (3, '小绿', '女', '16234231124', 30, 25, 2000);
INSERT INTO `student` VALUES (4, '王黄', '男', '16867454532', 20, 25, 8000);
INSERT INTO `student` VALUES (5, '小博', '男', '17639414630', 1, 50, 10000);
INSERT INTO `student` VALUES (6, '小嘻嘻', '男', '12345678654', 20, 33, 3444);
INSERT INTO `student` VALUES (7, '大嘻嘻', '女', '76543234561', 20, 33, 3333);

SET FOREIGN_KEY_CHECKS = 1;
