MYSQL必知必会使用数据

MYSQL必知必会使用数据

student表

/*
Navicat MySQL Data Transfer

Source Server         : mysql
Source Server Version : 50729
Source Host           : localhost:3306
Source Database       : mysqltest

Target Server Type    : MYSQL
Target Server Version : 50729
File Encoding         : 65001

Date: 2020-06-22 22:42:20
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `SId` varchar(10) DEFAULT NULL,
  `Sname` varchar(10) DEFAULT NULL,
  `Sage` datetime DEFAULT NULL,
  `Ssex` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of student
-- ----------------------------
INSERT INTO `student` VALUES ('01', '赵雷', '1990-01-01 00:00:00', '男');
INSERT INTO `student` VALUES ('02', '钱电', '1990-12-21 00:00:00', '男');
INSERT INTO `student` VALUES ('03', '孙风', '1990-12-20 00:00:00', '男');
INSERT INTO `student` VALUES ('04', '李云', '1990-12-06 00:00:00', '男');
INSERT INTO `student` VALUES ('05', '周梅', '1991-12-01 00:00:00', '女');
INSERT INTO `student` VALUES ('06', '吴兰', '1992-01-01 00:00:00', '女');
INSERT INTO `student` VALUES ('07', '郑竹', '1989-01-01 00:00:00', '女');
INSERT INTO `student` VALUES ('09', '张三', '2017-12-20 00:00:00', '女');
INSERT INTO `student` VALUES ('10', '李四', '2017-12-25 00:00:00', '女');
INSERT INTO `student` VALUES ('11', '李四', '2012-06-06 00:00:00', '女');
INSERT INTO `student` VALUES ('12', '赵六', '2013-06-13 00:00:00', '女');
INSERT INTO `student` VALUES ('13', '孙七', '2014-06-01 00:00:00', '女');

teacher表

/*
Navicat MySQL Data Transfer

Source Server         : mysql
Source Server Version : 50729
Source Host           : localhost:3306
Source Database       : mysqltest

Target Server Type    : MYSQL
Target Server Version : 50729
File Encoding         : 65001

Date: 2020-06-22 22:42:15
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for teacher
-- ----------------------------
DROP TABLE IF EXISTS `teacher`;
CREATE TABLE `teacher` (
  `TId` varchar(10) DEFAULT NULL,
  `Tname` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of teacher
-- ----------------------------
INSERT INTO `teacher` VALUES ('01', '张三');
INSERT INTO `teacher` VALUES ('02', '李四');
INSERT INTO `teacher` VALUES ('03', '王五');

sc表

/*
Navicat MySQL Data Transfer

Source Server         : mysql
Source Server Version : 50729
Source Host           : localhost:3306
Source Database       : mysqltest

Target Server Type    : MYSQL
Target Server Version : 50729
File Encoding         : 65001

Date: 2020-06-22 22:42:25
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for sc
-- ----------------------------
DROP TABLE IF EXISTS `sc`;
CREATE TABLE `sc` (
  `SId` varchar(10) DEFAULT NULL,
  `CId` varchar(10) DEFAULT NULL,
  `score` decimal(18,1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sc
-- ----------------------------
INSERT INTO `sc` VALUES ('01', '01', '80.0');
INSERT INTO `sc` VALUES ('01', '02', '90.0');
INSERT INTO `sc` VALUES ('01', '03', '99.0');
INSERT INTO `sc` VALUES ('02', '01', '70.0');
INSERT INTO `sc` VALUES ('02', '02', '60.0');
INSERT INTO `sc` VALUES ('02', '03', '80.0');
INSERT INTO `sc` VALUES ('03', '01', '80.0');
INSERT INTO `sc` VALUES ('03', '02', '80.0');
INSERT INTO `sc` VALUES ('03', '03', '80.0');
INSERT INTO `sc` VALUES ('04', '01', '50.0');
INSERT INTO `sc` VALUES ('04', '02', '30.0');
INSERT INTO `sc` VALUES ('04', '03', '20.0');
INSERT INTO `sc` VALUES ('05', '01', '76.0');
INSERT INTO `sc` VALUES ('05', '02', '87.0');
INSERT INTO `sc` VALUES ('06', '01', '31.0');
INSERT INTO `sc` VALUES ('06', '03', '34.0');
INSERT INTO `sc` VALUES ('07', '02', '89.0');
INSERT INTO `sc` VALUES ('07', '03', '98.0');

courese表

/*
Navicat MySQL Data Transfer

Source Server         : mysql
Source Server Version : 50729
Source Host           : localhost:3306
Source Database       : mysqltest

Target Server Type    : MYSQL
Target Server Version : 50729
File Encoding         : 65001

Date: 2020-06-22 22:42:30
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `CId` varchar(10) DEFAULT NULL,
  `Cname` varchar(10) DEFAULT NULL,
  `TId` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of course
-- ----------------------------
INSERT INTO `course` VALUES ('01', '语文', '02');
INSERT INTO `course` VALUES ('02', '数学', '01');
INSERT INTO `course` VALUES ('03', '英语', '03');


goods表

/*
Navicat MySQL Data Transfer

Source Server         : mysql
Source Server Version : 50729
Source Host           : localhost:3306
Source Database       : test

Target Server Type    : MYSQL
Target Server Version : 50729
File Encoding         : 65001

Date: 2020-06-22 22:42:42
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for goods
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
  `goods_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `goods_name` varchar(120) DEFAULT NULL,
  `cat_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `brand_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `goods_sn` char(15) NOT NULL DEFAULT '',
  `goods_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `shop_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `market_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `click_count` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`goods_id`)
) ENGINE=MyISAM AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of goods
-- ----------------------------
INSERT INTO `goods` VALUES ('1', 'kd876', '4', '8', 'ecs000000', '1', '1388.00', '1665.60', '9');
INSERT INTO `goods` VALUES ('4', '诺基亚n85原装充电器  ', '8', '1', 'ecs000004', '17', '58.00', '69.60', '0');
INSERT INTO `goods` VALUES ('3', '诺基亚原装5800耳机  ', '8', '1', 'ecs000002', '24', '68.00', '81.60', '3');
INSERT INTO `goods` VALUES ('5', '索爱原装m2卡读卡器', '11', '7', 'ecs000005', '8', '20.00', '24.00', '3');
INSERT INTO `goods` VALUES ('6', '胜创kingmax内存卡', '11', '0', 'ecs000006', '15', '42.00', '50.40', '0');
INSERT INTO `goods` VALUES ('7', '诺基亚n85原装立体声耳机hs-82', '8', '1', 'ecs000007', '20', '100.00', '120.00', '0');
INSERT INTO `goods` VALUES ('8', '飞利浦9@9v ', '1', '4', 'ecs000008', '1', '399.00', '478.79', '10');
INSERT INTO `goods` VALUES ('9', '飞利浦451', '2', '1', 'ecs000009', '4', '2298.00', '2757.60', '20');
INSERT INTO `goods` VALUES ('10', '索爱c702c', '1', '7', 'ecs000010', '7', '1328.00', '1593.60', '11');
INSERT INTO `goods` VALUES ('11', '索爱c702c', '2', '7', 'ecs000011', '1', '1300.00', '0.00', '0');
INSERT INTO `goods` VALUES ('12', '摩托罗拉a810', '2', '2', 'ecs000012', '8', '983.00', '1179.60', '13');
INSERT INTO `goods` VALUES ('13', '索爱c502c', '3', '1', 'ecs000013', '8', '1311.00', '1573.20', '13');
INSERT INTO `goods` VALUES ('14', '诺基亚5800xm', '4', '1', 'ecs000014', '1', '2625.00', '3150.00', '6');
INSERT INTO `goods` VALUES ('15', '摩托罗拉a810', '3', '2', 'ecs000015', '3', '788.00', '945.60', '8');
INSERT INTO `goods` VALUES ('16', '恒基伟业g101', '2', '11', 'ecs000016', '0', '823.33', '988.00', '3');
INSERT INTO `goods` VALUES ('17', '夏新n7', '4', '5', 'ecs000017', '1', '2300.00', '2760.00', '2');
INSERT INTO `goods` VALUES ('18', '夏新t5', '4', '5', 'ecs000018', '1', '2878.00', '3453.60', '0');
INSERT INTO `goods` VALUES ('19', '三星sgh-f258', '1', '6', 'ecs000019', '12', '858.00', '1029.60', '7');
INSERT INTO `goods` VALUES ('20', '三星bc01', '4', '6', 'ecs000020', '12', '280.00', '336.00', '14');
INSERT INTO `goods` VALUES ('21', '金立 a30', '3', '10', 'ecs000021', '40', '2000.00', '2400.00', '4');
INSERT INTO `goods` VALUES ('22', '多普达touch hd', '3', '3', 'ecs000022', '1', '5999.00', '7198.80', '16');
INSERT INTO `goods` VALUES ('23', '诺基亚n96', '5', '1', 'ecs000023', '8', '3700.00', '4440.00', '17');
INSERT INTO `goods` VALUES ('24', 'p806', '1', '9', 'ecs000024', '100', '2000.00', '2400.00', '35');
INSERT INTO `goods` VALUES ('25', '小灵通/固话50元充值卡', '13', '0', 'ecs000025', '2', '48.00', '57.59', '0');
INSERT INTO `goods` VALUES ('26', '小灵通/固话20元充值卡', '13', '0', 'ecs000026', '2', '19.00', '22.80', '0');
INSERT INTO `goods` VALUES ('27', '联通100元充值卡', '15', '0', 'ecs000027', '2', '95.00', '100.00', '0');
INSERT INTO `goods` VALUES ('28', '联通50元充值卡', '15', '0', 'ecs000028', '0', '45.00', '50.00', '0');
INSERT INTO `goods` VALUES ('29', '移动100元充值卡', '14', '0', 'ecs000029', '0', '90.00', '0.00', '0');
INSERT INTO `goods` VALUES ('30', '移动20元充值卡', '14', '0', 'ecs000030', '9', '18.00', '21.00', '1');
INSERT INTO `goods` VALUES ('31', '摩托罗拉e8 ', '3', '2', 'ecs000031', '1', '1337.00', '1604.39', '5');
INSERT INTO `goods` VALUES ('32', '诺基亚n85', '1', '1', 'ecs000032', '4', '3010.00', '3612.00', '9');
INSERT INTO `goods` VALUES ('33', null, '4', '0', 'ecs000033', '1', '1754.00', '1852.00', '6');
INSERT INTO `goods` VALUES ('34', null, '0', '0', 'ecs000033', '12', '2.00', '34.00', '0');


你可能感兴趣的:(书本学习)