-- ----------------------------
-- 客户表
-- ----------------------------
drop table if exists sys_customer;
create table sys_customer (
customer_id bigint(20) not null auto_increment comment '客户id',
customer_name varchar(30) default '' comment '客户姓名',
phonenumber varchar(11) default '' comment '手机号码',
sex varchar(20) default null comment '客户性别',
birthday datetime comment '客户生日',
remark varchar(500) default null comment '客户描述',
primary key (customer_id)
) engine=innodb auto_increment=1 comment = '客户表';
-- ----------------------------
-- 商品表
-- ----------------------------
drop table if exists sys_goods;
create table sys_goods (
goods_id bigint(20) not null auto_increment comment '商品id',
customer_id bigint(20) not null comment '客户id',
name varchar(30) default '' comment '商品名称',
weight int(5) default null comment '商品重量',
price decimal(6,2) default null comment '商品价格',
date datetime comment '商品时间',
type char(1) default null comment '商品种类',
primary key (goods_id)
) engine=innodb auto_increment=1 comment = '商品表';
-- ----------------------------
-- 产品表
-- ----------------------------
drop table if exists sys_product;
create table sys_product (
product_id bigint(20) not null auto_increment comment '产品id',
parent_id bigint(20) default 0 comment '父产品id',
product_name varchar(30) default '' comment '产品名称',
order_num int(4) default 0 comment '显示顺序',
status char(1) default '0' comment '产品状态(0正常 1停用)',
primary key (product_id)
) engine=innodb auto_increment=1 comment = '产品表';
-- ----------------------------
-- 学生表
-- ----------------------------
drop table if exists sys_student;
create table sys_student (
student_id int(11) auto_increment comment '编号',
student_name varchar(30) default '' comment '学生名称',
student_age int(3) default null comment '年龄',
student_hobby varchar(30) default '' comment '爱好(0代码 1音乐 2电影)',
student_sex char(1) default '0' comment '性别(0男 1女 2未知)',
student_status char(1) default '0' comment '状态(0正常 1停用)',
student_birthday datetime comment '生日',
primary key (student_id)
) engine=innodb auto_increment=1 comment = '学生信息表';
-- ----------------------------
-- 电话本
-- ----------------------------
-- auto-generated definition
create table biz_book
(
book_id bigint auto_increment comment '电话本ID'
primary key,
book_name varchar(50) not null comment '姓名',
book_phone varchar(50) not null comment '手机号',
book_birthday datetime not null comment '生日',
create_time datetime null comment '创建时间'
)
comment '电话本';
ruoyi-vue常用表格
数据库设计:客户、商品、产品与学生信息表
于 2022-04-25 22:56:28 首次发布
本文介绍了四个数据库表的设计,包括客户表sys_customer,包含客户ID、姓名、手机号、性别和生日等字段;商品表sys_goods,包含商品ID、客户ID、商品名称、重量、价格、日期和类型;产品表sys_product,包含产品ID、父产品ID、产品名称、显示顺序和状态;学生表sys_student,包含学生ID、姓名、年龄、爱好、性别、状态和生日。这些表用于存储不同领域的信息。

802

被折叠的 条评论
为什么被折叠?



