/*Navicat MySQL Data TransferSource Server : 本地MySQLSource Server Version : 80021Source Host : 127.0.0.1:3306Source Database : sqlroadTarget Server Type : MYSQLTarget Server Version : 80021File Encoding : 65001Date: 2020-09-13 21:58:33*/SET FOREIGN_KEY_CHECKS=0;-- ------------------------------ Table structure for customers-- ----------------------------DROP DATABASE IF EXISTS `sqlroad`;CREATE DATABASE `sqlroad` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_0900_ai_ci;DROP TABLE IF EXISTS `customers`;CREATE TABLE `customers` ( `客户ID` int NOT NULL AUTO_INCREMENT, `姓名` varchar(10) DEFAULT NULL, `地址` varchar(50) DEFAULT NULL, `城市` varchar(20) DEFAULT NULL, `邮编` char(6) DEFAULT NULL, `省份` varchar(20) DEFAULT NULL, PRIMARY KEY (`客户ID`)) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;-- ------------------------------ Records of customers-- ----------------------------INSERT INTO `customers` VALUES ('1', '张三', '北京路27号', '上海', '200000', '上海市');INSERT INTO `customers` VALUES ('2', '李四', '南京路12号', '杭州', '310000', '浙江省');INSERT INTO `customers` VALUES ('3', '王五', '花城大道17号', '广州', '510000', '广东省');INSERT INTO `customers` VALUES ('4', '马六', '江夏路19号', '武汉', '430000', '湖北省');INSERT INTO `customers` VALUES ('5', '赵七', '西二旗12号', '北京', '100000', '北京市');INSERT INTO `customers` VALUES ('6', '宋一', '黄埔大道2100号', '广州', '510000', '广东省');INSERT INTO `customers` VALUES ('7', '刘二', '朝阳西路14号', '北京', '100000', '北京市');-- ------------------------------ Table structure for orders-- ----------------------------DROP TABLE IF EXISTS `orders`;CREATE TABLE `orders` ( `订单ID` int NOT NULL AUTO_INCREMENT, `客户ID` int DEFAULT NULL, `员工ID` int DEFAULT NULL, `订单日期` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `发货ID` int DEFAULT NULL, PRIMARY KEY (`订单ID`)) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;-- ------------------------------ Records of orders-- ----------------------------INSERT INTO `orders` VALUES ('1', '3', '9', '2020-09-01 21:53:12', '3');INSERT INTO `orders` VALUES ('2', '4', '9', '2020-06-28 21:53:31', '5');INSERT INTO `orders` VALUES ('3', '6', '3', '2020-09-01 21:53:53', '3');INSERT INTO `orders` VALUES ('4', '3', '7', '2020-08-28 21:54:20', '4');INSERT INTO `orders` VALUES ('5', '1', '4', '2020-08-30 21:54:42', '4');-- ------------------------------ Table structure for products-- ----------------------------DROP TABLE IF EXISTS `products`;CREATE TABLE `products` ( `产品ID` int NOT NULL AUTO_INCREMENT, `名称` varchar(20) DEFAULT NULL, `供应商ID` int DEFAULT NULL, `目录ID` int DEFAULT NULL, `规格` varchar(50) DEFAULT NULL, `价格` decimal(18,2) DEFAULT NULL, PRIMARY KEY (`产品ID`)) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;-- ------------------------------ Records of products-- ----------------------------INSERT INTO `products` VALUES ('1', '面包', '1', '1', '10个/袋', '18.00');INSERT INTO `products` VALUES ('2', '大米', '1', '1', '25kg/袋', '75.00');INSERT INTO `products` VALUES ('3', '苹果', '1', '2', '10kg/箱', '50.00');INSERT INTO `products` VALUES ('4', '香蕉', '2', '2', '10kg/箱', '45.00');INSERT INTO `products` VALUES ('5', '雪梨', '2', '2', '10kg/箱', '60.00');-- ------------------------------ Table structure for suppliers-- ----------------------------DROP TABLE IF EXISTS `suppliers`;CREATE TABLE `suppliers` ( `供应商ID` int NOT NULL AUTO_INCREMENT, `供应商名称` varchar(20) DEFAULT NULL, `地址` varchar(50) DEFAULT NULL, `城市` varchar(20) DEFAULT NULL, `邮编` char(6) DEFAULT NULL, `省份` varchar(20) DEFAULT NULL, PRIMARY KEY (`供应商ID`)) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;-- ------------------------------ Records of suppliers-- ----------------------------INSERT INTO `suppliers` VALUES ('1', '沃尔玛', '北京路25号', '上海', '200000', '上海市');INSERT INTO `suppliers` VALUES ('2', '家乐福', '玄武街28号', '南京', '210000', '江苏省');INSERT INTO `suppliers` VALUES ('3', '永旺超市', '咸阳街1123号', '西安', '710000', '陕西省');
mysql基础表和修理表_MySQL基础知识——创建数据库和表
最新推荐文章于 2023-05-16 16:22:05 发布