Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬你好,方便发一下表设计吗? #15

Open
afei1217 opened this issue Apr 22, 2019 · 1 comment
Open

大佬你好,方便发一下表设计吗? #15

afei1217 opened this issue Apr 22, 2019 · 1 comment

Comments

@afei1217
Copy link

本人刚开始学习后台,想请教一下博客系列的表设计。

@lfb
Copy link
Owner

lfb commented Apr 22, 2019

本人刚开始学习后台,想请教一下博客系列的表设计。

您好,MySQL入门可以看这个:详细MySQL基本操作

你学习了MySQL(数据库)后,自己可以根据实际的需求情况来设计,做后台的话,数据库要学好,而且数据库太强大了,你要慢慢地学,以下的客户表您可以参照一下,有什么问题再问我:)

# 创建  boblog 数据库
CREATE DATABASE IF NOT EXISTS boblog DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

# 使用 boblog 数据库
USE boblog;

# 创建客户表
CREATE TABLE customers(
 cust_id INT NOT NULL AUTO_INCREMENT COMMENT '主键(自增长)',
 cust_name CHAR(50) NOT NULL COMMENT '客户姓名',
 cust_sex tinyint(2) NOT NULL DEFAULT 1 COMMENT '客户性别 1-男,2-女',
 cust_address CHAR(50) NULL COMMENT '客户地址',
 cust_contact CHAR(50) NULL COMMENT '客户联系方式',
PRIMARY KEY(cust_id)
)COMMENT = '客户表' ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants