smbms超市管理系统数据库建表sql

这段SQL脚本创建了一个名为`smbms`的数据库,并定义了四个表:`smbms_address`(地址)、`smbms_bill`(账单)、`smbms_provide`(供应商)和`smbms_user`(用户)。每个表都有其特定的字段和约束,如主键、外键等,用于存储联系信息、账单详情、供应商信息和用户数据。
摘要由CSDN通过智能技术生成

在这里插入图片描述


```sql
/*
SQLyog 企业版 - MySQL GUI v8.14 
MySQL - 5.7.17 : Database - smbms
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`smbms` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `smbms`;

/*Table structure for table `smbms_address` */

DROP TABLE IF EXISTS `smbms_address`;

CREATE TABLE `smbms_address` (
  `id` bigint(100) NOT NULL,
  `contact` varchar(100) DEFAULT NULL,
  `address_desc` varchar(100) DEFAULT NULL,
  `post_code` varchar(100) DEFAULT NULL,
  `tel` varchar(100) DEFAULT NULL,
  `created_by` bigint(50) DEFAULT NULL,
  `creation_date` date DEFAULT NULL,
  `modify_by` bigint(50) DEFAULT NULL,
  `modify_date` date DEFAULT NULL,
  `user_id` bigint(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `smbms_address` */

/*Table structure for table `smbms_bill` */

DROP TABLE IF EXISTS `smbms_bill`;

CREATE TABLE `smbms_bill` (
  `id` bigint(100) NOT NULL,
  `bill_code` varchar(100) DEFAULT NULL,
  `product_name` varchar(40) DEFAULT NULL,
  `product_desc` varchar(40) DEFAULT NULL,
  `product_unit` varchar(40) DEFAULT NULL,
  `product_count` decimal(12,2) DEFAULT NULL,
  `total_rice` decimal(12,2) DEFAULT NULL,
  `is_payment` int(10) DEFAULT NULL,
  `created_by` bigint(20) DEFAULT NULL,
  `creation_date` date DEFAULT NULL,
  `modify_by` bigint(100) DEFAULT NULL,
  `modify_date` date DEFAULT NULL,
  `provider_id` bigint(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `smbms_bill` */

/*Table structure for table `smbms_provide` */

DROP TABLE IF EXISTS `smbms_provide`;

CREATE TABLE `smbms_provide` (
  `id` bigint(100) NOT NULL,
  `pro_code` varchar(100) DEFAULT NULL,
  `pro_name` varchar(100) DEFAULT NULL,
  `pro_contact` varchar(100) DEFAULT NULL,
  `pro_phone` varchar(100) DEFAULT NULL,
  `pro_address` varchar(100) DEFAULT NULL,
  `pro_fax` varchar(100) DEFAULT NULL,
  `created_by` bigint(50) DEFAULT NULL,
  `creation_date` date DEFAULT NULL,
  `modify_date` date DEFAULT NULL,
  `modify_by` bigint(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `smbms_provide` */

/*Table structure for table `smbms_role` */

DROP TABLE IF EXISTS `smbms_role`;

CREATE TABLE `smbms_role` (
  `id` bigint(50) NOT NULL,
  `role_code` varchar(50) DEFAULT NULL,
  `role_name` varchar(50) DEFAULT NULL,
  `created_by` bigint(50) DEFAULT NULL,
  `creation_date` date DEFAULT NULL,
  `modify_by` bigint(50) DEFAULT NULL,
  `modify_date` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `smbms_role` */

/*Table structure for table `smbms_user` */

DROP TABLE IF EXISTS `smbms_user`;

CREATE TABLE `smbms_user` (
  `id` bigint(50) NOT NULL,
  `user_code` varchar(100) DEFAULT NULL,
  `user_name` varchar(100) DEFAULT NULL,
  `user_password` varchar(100) DEFAULT NULL,
  `gender` int(100) DEFAULT NULL,
  `birthday` date DEFAULT NULL,
  `phone` varchar(100) DEFAULT NULL,
  `address` varchar(20) DEFAULT NULL,
  `userRole` bigint(100) DEFAULT NULL,
  `created_by` bigint(100) DEFAULT NULL,
  `creation_date` date DEFAULT NULL,
  `modify_by` bigint(100) DEFAULT NULL,
  `modify_date` date DEFAULT NULL,
  `idPicPath` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `smbms_user` */

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

编写不易,爆肝呕血,求君一赞!

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值