Mysql在dos框创建便签项目

一、首先创建便签数据库

create database if not exists notes charset=utf8 collate utf8_general_ci;
use notes;

二、创建便签组:

-便签组编号   -便签组组名    -创建时间  -修改时间  -删除时间

create table if not exists note_groups(
id int primary key auto_increment comment'便签组编号',
group_name varchar(20) not null unique comment'便签组名称',
create_date datatime comment'创建时间’,
modify_date timestamp comment'修改时间',
delete_data datatime comment'删除时间'
);

三、创建便签表:

-便签编号   —便签标题   -内容     -是否私密   -背景颜色   —是否提醒
-是否删除   -提醒时间    创建时间 -修改时间    -删除时间  -便签组编号

create table if not exists note_mark(
id int primary key auto_increment commentt‘便签编号’,
title varchar(20) not null commentt'便签标题',
content varchar(1000) commentt'内容',
is_secret boolean commentt'是否私密,0表示公开,1表示私密',
background enum('red','white','blue','black') comment'背景颜色',
is_remind boolean comment'是否提醒',
is_delete char(1) default '0' comment'是否删除,0表示未删除,1表示删除',
remind_data datatime comment'提醒时间',
create_date datatime comment'创建时间',
modify_date timestamp comment'修改时间',
delete_data datatime comment'删除时间',
group_id int not null comment'便签组编号',
foreign key (group_id) references note_groups(id)
);

四、 创建便签分享

create table if not exists note_shares(
share_id int primary key auto_increment comment'便签分享编号',
id int not null comment‘便签编号’,
share_remark varchar(1000) comment'分享备注',
share_data datatime comment'分享时间',
delete_data datatime comment'删除时间',
create_date datatime comment'创建时间'
foreign key (id) references note_mark(id)
);

五、创建结果 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值