MySQL数据库测试⽤表
MySQL⾃我学习路线
数据库测试⽤表
数据库名称:student
表名:student、course、sc
/*
Navicat Premium Data Transfer
Source Server : 192.168.1.100
Source Server Type : MySQL
Source Server Version : 50730
Source Host : localhost:3306
Source Schema : studentphp502 bad gateway
Target Server Type : MySQL
Target Server Version : 50730
File Encoding : 65001
Date: 09/10/2020 20:42:31
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS =0;
-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS`course`;
CREATE TABLE`course`(
`cno`varchar(10)CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT'课程号',
`cname`varchar(20)CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT'课程名',
`credit`int(11)NULL DEFAULT NULL COMMENT'学分',
`semester`int(11)NULL DEFAULT NULL COMMENT'开课学期',
PRIMARY KEY(`cno`)USING BTREE
)ENGINE=InnoDB CHARACTER SET= utf8 COLLATE= utf8_general_ci ROW_FORMAT = Dynamic;
mysql面试题测试-- ----------------------------
-- Records of course
-- ----------------------------
INSERT INTO`course`VALUES('C001','⾼等数学',4,1);
INSERT INTO`course`VALUES('C002','⼤学英语',3,1);
INSERT INTO`course`VALUES('C003','⼤学英语',3,2);
INSERT INTO`course`VALUES('C004','计算机⽂化学',2,2);
INSERT INTO`course`VALUES('C005','Java',2,3);
INSERT INTO`course`VALUES('C006','数据库基础',4,5);
INSERT INTO`course`VALUES('C007','数据结构',4,4);
INSERT INTO`course`VALUES('C008','计算机⽹络',4,4);
-- ----------------------------asta
-- Table structure for sc
-- ----------------------------
DROP TABLE IF EXISTS`sc`;
CREATE TABLE`sc`(
`sno`varchar(7)CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT'学号',
`cno`varchar(10)CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT'课程号',
`grade`int(11)NULL DEFAULT NULL COMMENT'成绩',
PRIMARY KEY(`sno`,`cno`)USING BTREE,
INDEX`Cno`(`cno`)USING BTREE,
CONSTRAINT`sc_ibfk_1`FOREIGN KEY(`sno`)REFERENCES`student`(`sno`)ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT`sc_ibfk_2`FOREIGN KEY(`cno`)REFERENCES`course`(`cno`)ON DELETE RESTRICT ON UPDATE RESTRICT
)ENGINE=InnoDB CHARACTER SET= utf8 COLLATE= utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of sc
-- ----------------------------
INSERT INTO`sc`VALUES('0811101','C001',96);
INSERT INTO`sc`VALUES('0811101','C002',80);
INSERT INTO`sc`VALUES('0811101','C003',84);
INSERT INTO`sc`VALUES('0811101','C005',62);
INSERT INTO`sc`VALUES('0811102','C001',92);
INSERT INTO`sc`VALUES('0811102','C002',90);
INSERT INTO`sc`VALUES('0811102','C003',85);
INSERT INTO`sc`VALUES('0811102','C004',84);
INSERT INTO`sc`VALUES('0811102','C005',73);
INSERT INTO`sc`VALUES('0811102','C006',76);
INSERT INTO`sc`VALUES('0811102','C007',NULL);
INSERT INTO`sc`VALUES('0811103','C001',50);
INSERT INTO`sc`VALUES('0811103','C004',80);
INSERT INTO`sc`VALUES('0831101','C001',50);
INSERT INTO`sc`VALUES('0831101','C004',80);
INSERT INTO`sc`VALUES('0831102','C007',NULL);
INSERT INTO`sc`VALUES('0831103','C004',78);
INSERT INTO`sc`VALUES('0831103','C005',65);
aversionINSERT INTO`sc`VALUES('0831103','C007',NULL);
-- ----------------------------
-
- Table structure for studentweb中service层的作用
-- ----------------------------
DROP TABLE IF EXISTS`student`;
CREATE TABLE`student`(
`sno`varchar(7)CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT'学号',
`sname`varchar(10)CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT'姓名',
`ssex`varchar(2)CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT'性别',
`sage`int(11)NULL DEFAULT NULL COMMENT'年龄',
`dept`varchar(20)CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT'所在系', PRIMARY KEY(`sno`)USING BTREE
)ENGINE=InnoDB CHARACTER SET= utf8 COLLATE= utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of student
-- ----------------------------
INSERT INTO`student`VALUES('0811101','李勇','男',21,'计算机系');
hex字符串是什么INSERT INTO`student`VALUES('0811102','刘晨','男',20,'计算机系');
INSERT INTO`student`VALUES('0811103','王敏','⼥',20,'计算机系');
INSERT INTO`student`VALUES('0811104','张⼩红','⼥',19,'计算机系');
INSERT INTO`student`VALUES('0821101','张⽴','男',20,'信息管理系');
INSERT INTO`student`VALUES('0821102','吴宾','⼥',19,'信息管理系');
INSERT INTO`student`VALUES('0821103','张海','男',20,'信息管理系');
INSERT INTO`student`VALUES('0831101','钱⼩平','⼥',21,'通信⼯程系');
INSERT INTO`student`VALUES('0831102','王⼤⼒','男',20,'通信⼯程系');
INSERT INTO`student`VALUES('0831103','张珊珊','⼥',19,'通信⼯程系');
SET FOREIGN_KEY_CHECKS =1;
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论