Verified Commit 59fd5e99 authored by Kiryuu Sakuya's avatar Kiryuu Sakuya 🎵
Browse files

Finish No.2

parent 8aeb8d14
-- MariaDB dump 10.17 Distrib 10.4.10-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: studentdb
-- ------------------------------------------------------
-- Server version 10.4.10-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `customer`
--
DROP TABLE IF EXISTS `customer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer` (
`cust_id` char(6) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户号',
`cust_name` char(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户名称',
`addr` char(40) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户住址',
`tel_no` char(15) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户电话',
`zip` char(8) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮政编码',
PRIMARY KEY (`cust_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `customer`
--
LOCK TABLES `customer` WRITE;
/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `employee`
--
DROP TABLE IF EXISTS `employee`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee` (
`emp_no` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '员工编号',
`emp_name` char(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '员工姓名',
`emp_sex` char(1) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '性别',
`emp_dept` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '所属部门',
`emp_title` char(6) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '职称',
`emp_date_hired` datetime NOT NULL COMMENT '到职日',
`emp_birthday` datetime NOT NULL COMMENT '生日',
`emp_salary` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '薪水',
`emp_addr` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '住址',
`emp_mod_date` datetime NOT NULL DEFAULT current_timestamp() COMMENT '操作时间',
PRIMARY KEY (`emp_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `employee`
--
LOCK TABLES `employee` WRITE;
/*!40000 ALTER TABLE `employee` DISABLE KEYS */;
/*!40000 ALTER TABLE `employee` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product`
--
DROP TABLE IF EXISTS `product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product` (
`prod_id` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产品编号',
`prod_name` char(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产品名称',
PRIMARY KEY (`prod_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product`
--
LOCK TABLES `product` WRITE;
/*!40000 ALTER TABLE `product` DISABLE KEYS */;
/*!40000 ALTER TABLE `product` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sale_item`
--
DROP TABLE IF EXISTS `sale_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sale_item` (
`order_no` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '订单编号',
`prod_id` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产品编号',
`qty` int(11) NOT NULL COMMENT '销售数量',
`unit_price` decimal(9,2) NOT NULL COMMENT '单价',
`order_date` datetime NOT NULL COMMENT '订单日期',
PRIMARY KEY (`order_no`,`prod_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sale_item`
--
LOCK TABLES `sale_item` WRITE;
/*!40000 ALTER TABLE `sale_item` DISABLE KEYS */;
/*!40000 ALTER TABLE `sale_item` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sales`
--
DROP TABLE IF EXISTS `sales`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales` (
`order_no` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '订单编号',
`cust_id` char(6) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户号',
`sale_id` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '业务员编号',
`tot_amt` decimal(9,2) NOT NULL COMMENT '订单金额',
`order_date` datetime NOT NULL COMMENT '订货日期',
`ship_date` datetime NOT NULL COMMENT '出货日期',
`invoice_no` char(8) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '发票号码',
PRIMARY KEY (`order_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sales`
--
LOCK TABLES `sales` WRITE;
/*!40000 ALTER TABLE `sales` DISABLE KEYS */;
/*!40000 ALTER TABLE `sales` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-11-10 15:53:54
-- MariaDB dump 10.17 Distrib 10.4.10-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: studentdb
-- ------------------------------------------------------
-- Server version 10.4.10-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `customer`
--
DROP TABLE IF EXISTS `customer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer` (
`cust_id` char(6) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户号',
`cust_name` char(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户名称',
`addr` char(40) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户住址',
`tel_no` char(15) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户电话',
`zip` char(8) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮政编码',
PRIMARY KEY (`cust_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `customer`
--
LOCK TABLES `customer` WRITE;
/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
INSERT INTO `customer` VALUES ('100000','张三丰','江西省景德镇市浮梁县湘湖镇景德镇陶瓷大学湘湖校区','+86199484935556','333403'),('100001','高濑智章','日本秋田県横手市十文字町西原二番町','+81976313164','127-1196'),('100002','潘易梦','上海市静安区昌平路645弄1-5号东安公寓','+8618834527335','200040'),('100003','袁光文','上海市静安区浙江北路403弄之1-88号华安坊','+8615078342223','200040'),('100004','江渲染','浙江省杭州市下城区河东路136号朝晖五区','+8613044538964','310014'),('100005','黄湘云','浙江省杭州市余杭区瓶窑镇彭公村钱家坞翰泽实业','+8617663452324','311115'),('100006','周玲然','北京市通州区北大街后安福胡同万宁小区15壕楼','+8613802653467','101100'),('100007','郝俨雅','黑龙江省鹤岗市向阳区西红星街红星楼小区3号楼2单元302室','+8619928472345','154100'),('100008','杨德庸','重庆市涪陵区体育北路时代文具','+8618629342495','408000'),('100009','丁建德','青海省海北藏族自治州海晏县三角城镇三角城村','+8617686475333','812299'),('100010','贾宇航','湖南省长沙市开福区希贤里金帆·江滨玫瑰园22栋','+8615133458842','410005'),('100011','龚建章','广东省广州市白云区广州大道北白山村白山东路佳润云凯雅寓2座','+8613057552324','510515'),('100012','于飞宇','海南省海口市龙华区新建街美的','+8617449593235','571156'),('100013','邱锦程','天津市和平区包头道云台花园7号楼','+8615593452093','300020'),('100014','钱嘉赐','西藏自治区拉萨市尼木县续迈乡续迈村中国农业银行','+8615889099999','851317');
/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `employee`
--
DROP TABLE IF EXISTS `employee`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employee` (
`emp_no` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '员工编号',
`emp_name` char(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '员工姓名',
`emp_sex` char(1) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '性别',
`emp_dept` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '所属部门',
`emp_title` char(6) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '职称',
`emp_date_hired` datetime NOT NULL COMMENT '到职日',
`emp_birthday` datetime NOT NULL COMMENT '生日',
`emp_salary` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '薪水',
`emp_addr` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '住址',
`emp_mod_date` datetime NOT NULL DEFAULT current_timestamp() COMMENT '操作时间',
PRIMARY KEY (`emp_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `employee`
--
LOCK TABLES `employee` WRITE;
/*!40000 ALTER TABLE `employee` DISABLE KEYS */;
INSERT INTO `employee` VALUES ('10000','马化腾','男','董事会','总经理','2016-10-01 09:00:00','1998-07-11 12:00:00','25111','中华人民共和国北京市西城区西长安街街道','2019-11-10 15:27:57'),('10001','刘强东','男','董事会','副经理','2016-10-01 09:00:00','1974-12-16 15:00:00','20000','深圳市龙华区民治街道梅龙路2号星河盛世','2019-11-10 15:27:57'),('10002','董明珠','女','财务部','会计','2016-10-01 09:00:00','1954-08-01 17:00:00','5251','广州市越秀区培正路2号','2019-11-10 15:27:57'),('10003','张一鸣','男','董事会','财务经理','2016-10-01 09:00:00','1979-02-12 15:30:00','10000','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('10004','张二鸣','男','董事会','人事经理','2016-10-02 14:00:00','1980-03-19 20:01:15','10000','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('10005','张三鸣','女','董事会','办公室主任','2016-10-03 12:42:32','1981-04-20 12:56:22','10000','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('10006','张四鸣','女','董事会','销售经理','2016-10-04 09:15:24','1982-12-10 03:25:59','10000','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('20001','王维林','男','销售部','销售人员','2016-10-01 09:00:00','1989-06-04 23:00:00','3400','北京市东城区台基厂头条14号院','2019-11-10 15:27:57'),('20002','马云','男','销售部','销售人员','2016-10-01 09:00:00','1964-09-10 02:51:00','3600','北京市朝阳区西大望路西大望路甲12号','2019-11-10 15:27:57'),('20003','张五鸣','男','人力资源部','文员','2016-10-05 11:12:13','1985-04-01 02:51:22','3500','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('20004','张六鸣','男','销售部','市场助理','2016-10-05 11:12:13','1986-02-15 09:22:34','4000','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('20005','张七鸣','女','财务部','会计','2016-10-04 21:09:00','1987-02-22 14:28:59','5000','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('20006','张八鸣','女','财务部','出纳','2016-10-09 21:00:00','1988-06-12 14:22:34','4500','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('20007','张九鸣','男','后勤部','主管','2016-10-10 11:23:55','1989-06-04 12:16:00','7500','江西省景德镇市珠山区广场北路广瑞公寓一期7号楼1单元201室','2019-11-10 15:27:57'),('20008','张十鸣','男','后勤部','文员','2017-01-15 15:33:32','1978-12-23 09:22:14','4500','四川省成都市成华区升仙湖北路2号红花堰小区3号楼','2019-11-10 15:27:57'),('99999','龙玉涛','男','NaN','NaN','0000-00-00 00:00:00','0000-00-00 00:00:00','0','NaN','2019-11-10 15:28:31');
/*!40000 ALTER TABLE `employee` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product`
--
DROP TABLE IF EXISTS `product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product` (
`prod_id` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产品编号',
`prod_name` char(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产品名称',
PRIMARY KEY (`prod_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product`
--
LOCK TABLES `product` WRITE;
/*!40000 ALTER TABLE `product` DISABLE KEYS */;
INSERT INTO `product` VALUES ('D0001','このはな綺譚 dアニメストア Prime Video 12 集全 WEB-DL'),('D0002','うらら迷路帖 千箭限量版1/8比例PVC制已涂装完成品手办'),('D0003','日本百乐/PILOT BXS-IC一次性墨胆 新款V5升级版墨胆适用于BXC-V5'),('D0004','日本百乐/PILOT BXC-V5水性笔 V5升级版环保版/可换墨胆/新款水笔'),('D0005','日本PILOT/百乐中性笔BL-P50 P500/针管考试水笔0.5MM水性笔'),('T0001','海飞丝去屑洗发露止痒呵护型 750ml 促销款'),('T0002','舒肤佳柠檬清香健康+清爽系列沐浴露 400ml'),('T0003','红双喜羽毛球拍双拍 成人学生2只装控球全碳素纤维进攻型'),('T0004','山丘熊猫纸 竹浆本色抽纸500 家用整箱卫生纸3层120抽16包再赠3包'),('T0005','家居拖鞋女夏2018新款防滑室内居家用浴室洗澡情侣女士凉拖鞋男士'),('V0001','江西联通10元 联通话费 自动充值 直充快充 快速到账'),('V0002','CSDN代下载 CSDN不限积分 CSDN代下 24h自动发 无需咨询'),('V0003','自动发货 美国苹果5美元 Apple iTunes美金正规卡gift card'),('V0004','niconico 1个月 白金会员账号+PASS(自动发货)'),('V0005','测试商品 请勿拍');
/*!40000 ALTER TABLE `product` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sale_item`
--
DROP TABLE IF EXISTS `sale_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sale_item` (
`order_no` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '订单编号',
`prod_id` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产品编号',
`qty` int(11) NOT NULL COMMENT '销售数量',
`unit_price` decimal(9,2) NOT NULL COMMENT '单价',
`order_date` datetime NOT NULL COMMENT '订单日期',
PRIMARY KEY (`order_no`,`prod_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sale_item`
--
LOCK TABLES `sale_item` WRITE;
/*!40000 ALTER TABLE `sale_item` DISABLE KEYS */;
INSERT INTO `sale_item` VALUES ('11035462019090116054034524','T0001',1,56.50,'2019-09-01 16:05:40'),('11035462019090211345678134','D0002',5,100.40,'2019-09-02 11:34:56'),('11035462019090312553243345','D0003',10,7.00,'2019-09-03 12:55:32'),('11035462019090413452234535','D0003',20,7.00,'2019-09-04 13:45:22'),('11035462019090514523456734','V0001',1,10.00,'2019-09-05 14:52:34'),('11035462019090609452277643','D0005',4,25.00,'2019-09-06 09:45:22'),('11035462019090710231334567','T0005',2,8.60,'2019-09-07 10:23:13'),('11035462019090810204462563','V0004',1,5.00,'2019-09-08 10:20:44'),('11035462019090923452228404','V0003',1,35.00,'2019-09-09 23:45:22'),('11035462019091021342023750','T0003',1,89.00,'2019-09-10 21:34:20'),('11035462019091109080728562','D0004',5,10.00,'2019-09-11 09:08:07'),('11035462019111100000020957','T0004',1,29.00,'2019-11-11 00:00:00'),('11035462019111100000029425','V0003',10,35.00,'2019-11-11 00:00:00'),('11035462019111100000036455','V0002',1,1.00,'2019-11-11 00:00:00'),('11035462019111100000123945','D0004',5,10.00,'2019-11-11 00:00:01');
/*!40000 ALTER TABLE `sale_item` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sales`
--
DROP TABLE IF EXISTS `sales`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales` (
`order_no` varchar(26) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '订单编号',
`cust_id` char(6) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户号',
`sale_id` char(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '业务员编号',
`tot_amt` decimal(9,2) NOT NULL COMMENT '订单金额',
`order_date` datetime NOT NULL COMMENT '订货日期',
`ship_date` datetime NOT NULL COMMENT '出货日期',
`invoice_no` char(8) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '发票号码',
PRIMARY KEY (`order_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sales`
--
LOCK TABLES `sales` WRITE;
/*!40000 ALTER TABLE `sales` DISABLE KEYS */;
INSERT INTO `sales` VALUES ('11035462019090116054034524','100000','20001',56.50,'2019-09-01 16:05:40','2019-09-01 18:23:02','34600350'),('11035462019090211345678134','100001','20002',2510.00,'2019-09-02 11:34:56','2019-09-04 13:01:22','34600352'),('11035462019090312553243345','100002','20001',70.00,'2019-09-03 12:55:32','2019-09-03 15:05:23','34600354'),('11035462019090413452234535','100003','20002',140.00,'2019-09-04 13:45:22','2019-09-04 14:00:00','34600356'),('11035462019090514523456734','100004','20001',10.00,'2019-09-05 14:52:34','2019-09-05 14:52:35','34600358'),('11035462019090609452277643','100005','20001',100.00,'2019-09-06 09:45:22','2019-09-06 17:33:55','34600360'),('11035462019090710231334567','100006','20001',17.20,'2019-09-07 10:23:13','2019-09-07 12:00:05','34600362'),('11035462019090810204462563','100007','20002',5.00,'2019-09-08 10:20:44','2019-09-08 20:45:00','34600364'),('11035462019090923452228404','100008','20002',35.00,'2019-09-09 23:45:22','2019-09-10 00:00:00','34600366'),('11035462019091021342023750','100009','20002',89.00,'2019-09-10 21:34:20','2019-09-11 09:11:32','34600368'),('11035462019091109080728562','100010','20002',50.00,'2019-09-11 09:08:07','2019-09-11 12:06:22','34600370'),('11035462019111100000020957','100012','20002',1.00,'2019-11-11 00:00:00','2019-11-11 08:11:43','34600376'),('11035462019111100000023945','100013','20001',29.00,'2019-11-11 00:00:00','2019-11-11 10:30:22','34600378'),('11035462019111100000036455','100011','20002',350.00,'2019-11-11 00:00:00','2019-11-11 08:11:43','34600374'),('11035462019111100000129425','100008','20001',50.00,'2019-11-11 00:00:01','2019-11-11 10:30:22','34600372');
/*!40000 ALTER TABLE `sales` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-11-10 15:47:03
# 给 MariaDB 设置 UTF-8
## 为什么?
因为 MySQL / MariaDB 的 UTF-8 是假 UTF-8。
> The “utf8” encoding only supports three bytes per character. The real UTF-8 encoding — which everybody uses, including you — needs up to four bytes per character.
## 设置
> 以 Linux 系统为例
关闭 MariaDB,打开 `/etc/my.cnf`,输入以下代码:
```
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
init-connect='SET NAMES utf8mb4'
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
```
然后启动 MariaDB,输入 `show variables like "%character%";show variables like "%collation%";`
这时看看是否 `character_set_client`, `character_set_connection``character_set_database` 为 utf8mb4。
如果是的话,那么退出 MariaDB,将以前的表进行自动转换:
```
mysqlcheck -u root -p --auto-repair --optimize --all-databases
```
当然,你也可以手动转换:
```
# For each database:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
# For each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# For each column:
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# (Don’t blindly copy-paste this! The exact statement depends on the column type, maximum length, and other properties. The above line is just an example for a `VARCHAR` column.)
```
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment