加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pets.sql 5.83 KB
一键复制 编辑 原始数据 按行查看 历史
hidewnd 提交于 2021-01-18 11:15 . all
/*
Navicat MySQL Data Transfer
Source Server : sql_web
Source Server Version : 50640
Source Host : localhost:3306
Source Database : pets
Target Server Type : MYSQL
Target Server Version : 50640
File Encoding : 65001
Date: 2021-01-02 15:09:47
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for category
-- ----------------------------
DROP TABLE IF EXISTS `category`;
CREATE TABLE `category` (
`CatID` int(11) NOT NULL AUTO_INCREMENT,
`CatName` varchar(255) NOT NULL,
PRIMARY KEY (`CatID`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of category
-- ----------------------------
INSERT INTO `category` VALUES ('1', '猫');
INSERT INTO `category` VALUES ('2', '狗');
INSERT INTO `category` VALUES ('3', '宠物用品');
-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`CID` int(11) NOT NULL,
`UID` int(11) NOT NULL,
`CDate` datetime DEFAULT NULL,
`CMsg` varchar(255) DEFAULT NULL,
PRIMARY KEY (`CID`),
KEY `fk_comment_user` (`UID`),
CONSTRAINT `fk_comment_user` FOREIGN KEY (`UID`) REFERENCES `user` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of comment
-- ----------------------------
-- ----------------------------
-- Table structure for good
-- ----------------------------
DROP TABLE IF EXISTS `good`;
CREATE TABLE `good` (
`GID` int(11) NOT NULL AUTO_INCREMENT,
`GName` varchar(255) NOT NULL,
`CatID` int(11) NOT NULL,
`GMsg` varchar(255) DEFAULT NULL,
`Gsrc` varchar(255) DEFAULT NULL,
`GPrice` decimal(10,2) NOT NULL,
`Gnum` int(11) unsigned DEFAULT '0',
PRIMARY KEY (`GID`),
KEY `fk_good_category` (`CatID`),
CONSTRAINT `fk_good_category` FOREIGN KEY (`CatID`) REFERENCES `category` (`CatID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of good
-- ----------------------------
INSERT INTO `good` VALUES ('1', '猫', '1', '猫', '1', '15.00', '5');
INSERT INTO `good` VALUES ('16', 'aa', '1', 'aa', '4', '0.00', '1');
INSERT INTO `good` VALUES ('18', '二哈', '1', '二哈', 'Resources/images/1609571298685.jpg', '12.00', '4');
-- ----------------------------
-- Table structure for images
-- ----------------------------
DROP TABLE IF EXISTS `images`;
CREATE TABLE `images` (
`IID` int(11) NOT NULL AUTO_INCREMENT,
`Iurl` varchar(255) DEFAULT NULL,
PRIMARY KEY (`IID`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of images
-- ----------------------------
INSERT INTO `images` VALUES ('0', 'Resources/images/1609477464807.jpg');
INSERT INTO `images` VALUES ('1', 'Resources/images/1609477464822.jpg');
INSERT INTO `images` VALUES ('4', 'Resources/images/1609504290280.jpg');
-- ----------------------------
-- Table structure for order
-- ----------------------------
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
`OID` int(11) NOT NULL AUTO_INCREMENT,
`UID` int(11) NOT NULL,
`GID` int(11) DEFAULT NULL,
`ONum` int(11) DEFAULT NULL,
`status` int(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`OID`,`UID`),
KEY `fk_order_user` (`UID`),
KEY `fk_order_good` (`GID`),
CONSTRAINT `fk_order_good` FOREIGN KEY (`GID`) REFERENCES `good` (`GID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_order_user` FOREIGN KEY (`UID`) REFERENCES `user` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=652 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of order
-- ----------------------------
INSERT INTO `order` VALUES ('648', '1', '1', '10', '0');
INSERT INTO `order` VALUES ('649', '1', '16', '1', '0');
INSERT INTO `order` VALUES ('650', '22', '1', '5', '1');
INSERT INTO `order` VALUES ('651', '1', '1', '16', '1');
-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`RID` int(11) NOT NULL AUTO_INCREMENT,
`RName` varchar(255) DEFAULT NULL,
PRIMARY KEY (`RID`),
KEY `RID` (`RID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('1', '管理员');
INSERT INTO `role` VALUES ('2', '普通用户');
INSERT INTO `role` VALUES ('3', '访客');
INSERT INTO `role` VALUES ('5', 'texts');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`UID` int(11) NOT NULL AUTO_INCREMENT,
`RID` int(11) NOT NULL DEFAULT '2',
`UName` varchar(36) NOT NULL,
`Pwd` varchar(36) NOT NULL,
`USex` varchar(4) DEFAULT NULL,
`Email` varchar(64) DEFAULT NULL,
`URelN` varchar(64) CHARACTER SET utf8 DEFAULT NULL,
`Add` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`Utel` varchar(20) DEFAULT NULL,
`Ubalance` decimal(50,0) unsigned zerofill DEFAULT NULL,
PRIMARY KEY (`UID`),
KEY `fk_user_role` (`RID`),
CONSTRAINT `fk_user_role` FOREIGN KEY (`RID`) REFERENCES `role` (`RID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', '1', 'hidewindzz', '123', '男', 'null', 'admin', 'null', 'null', '00000000000000000000000000000000000000000000001000');
INSERT INTO `user` VALUES ('18', '1', 'text', '123', '男', '', '123', '', '', '00000000000000000000000000000000000000000000000000');
INSERT INTO `user` VALUES ('19', '2', 'bb', '111', null, null, null, null, null, null);
INSERT INTO `user` VALUES ('22', '1', 'admin', 'admin', '男', '', '', '', '', '00000000000000000000000000000000000000000000000100');
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化