数据库小项目--便签应用

便签是我们都很熟悉的东西,不论生活和学习中,小小的它给我们提供了很大的便利,学了数据库之后就动手实现了一个便签小项目,分享给大家叭!

1.需求分析

1.1 功能性需求分析

功能性产品需求,主要面向基本需求,具有生命周期长,需求稳定,便于预测,产品改型少的特点

  • 便签
  1. 创建便签
  2. 修改便签
  3. 删除便签
  • 便签组  
  1. 创建便签组
  2. 修改便签组
  3. 删除便签组 
  • 检索 
  1. 便签时间搜索
  2. 便签内容搜索 

1.2 创新性需求

创新性产品需求,是面向变化的需求,具有生命周期短,需求不稳定,难以预测,产品改型大的特点

  • 便签背景颜色
  • 便签提醒
  • 便签私密
  • 便签备份 
  1.  全部备份
  2. 便签组备份
  3. 便签备份 
  •  便签分享

 2. 模型设计

 2.1 便签模型

  • 便签表
  1.  编号
  2. 标题
  3. 内容
  4. 是否私密
  5. 背景颜色是否提醒
  6. 提醒时间
  7. 创建时间
  8. 修改时间
  9. 所属分组 

2.2 便签组模型

  • 便签组 
  1. 编号
  2. 组名称
  3. 创建时间
  4. 修改时间

2.3 便签分享模型

  • 便签分享
  1. 编号
  2. 标签编号
  3. 分享备注
  4. 分享时间

3.数据库设计 

模型设计
2.1便签模型
   --便签表
      --编号 --标题 --内容  -- 是否私密  
      --背景颜色  --是否提醒  --提醒时间  
      --创建时间  --修改时间  --所属分组
create database if exists 'memo';
create database if not exists 'memo' default character set utf8 collate utf8_general_ci;
use 'memo';
drop table if exists memo; 
create table if not exists memo(
id int primary key auto_increment comment'便签编号',
title varchar(30) comment'便签标题',
content varchar(100) not null comment'便签内容',
is_select bit('是','否')comment'是否私密,0非私密,1私密',
background enum('红','黄','蓝')comment'背景颜色',
is_call enum('是','否') comment'是否提醒',
call_time datetime comment'提醒时间',
create_time datetime comment'创建时间',
modify_time timestamp comment'修改时间',
groups int default null comment '分组编号');


2.2 便签组模型
    --便签组
      --编号  --组名称  --创建时间  --修改时间
create table if not exists memo_group(
id int primary key auto_increment comment'分组编号',
group_name varchar(10) not null comment'分组名称',
create_time datetime comment'创建时间',
modify_time timestamp comment'修改时间');

2.3 便签分享模型
    --便签分享
       --编号  --标签编号  --分享备注  --分享时间
create  table if not exists memo_share(
id int primary key auto_increment comment'分享编号',
memo_id int not null comment'标签编号',
share_mark varchar(30) comment'分享备注',
share_time datetime comment'分享时间',
foreign key id references memo(groups));--外键

  

猜你喜欢

转载自blog.csdn.net/weixin_43224539/article/details/88758699