zoukankan      html  css  js  c++  java
  • ylbtech-memorandum(备忘录)-数据库设计

    ylbtech-DatabaseDesgin:ylbtech-memorandum(备忘录)-数据库设计

    -- =============================================
    -- DatabaseName:ylbtech_memorandum
    -- Desc: 备忘录
    -- Model:
    -- pubdate:15:50 2014-12-30
    -- author:Yuanbo
    -- http://*.com/
    -- =============================================

    1.A,数据库关系图(Database Diagram) 返回顶部

     

    1.B,数据库设计脚本(Database Design Script)返回顶部

    1.B.1,

    use master
    go
    -- =============================================
    -- DatabaseName:Memorandum
    -- Desc: 备忘录
    -- Model:
    -- pubdate:15:50 2014-12-30
    -- author:Yuanbo
    -- http://*.com/
    -- =============================================
    IF EXISTS (SELECT * 
           FROM   master..sysdatabases 
           WHERE  name = N'ylbtech_memorandum')
        DROP DATABASE ylbtech_memorandum
    GO
    
    CREATE DATABASE ylbtech_memorandum
    GO
    use ylbtech_memorandum
    
    
    GO
    -- =============================================
    -- ylb:1,分类
    -- =============================================
    create table Category
    (
    category_id uniqueidentifier primary key,    --编号【UI,PK】
    category_name varchar(200),    --名称
    grade uniqueidentifier     --级别
    )
    GO
    -- =============================================
    -- ylb:1,标签表
    -- =============================================
    create table Tag
    (
    tag_id uniqueidentifier primary key,    --编号【UI,PK】
    tag_name varchar(200)    --标签
    )
    
    GO
    -- =============================================
    -- ylb:1,附件表
    -- =============================================
    create table Attachment
    (
    attachment_id uniqueidentifier primary key,    --编号【UI,PK】
    attachment_name varchar(200),    --文件
    type varchar(200),        --类型(附件连接|数据库附件|拷贝附件)
    pubdate datetime default(getdate())    --添加时间
    )
    
    
    GO
    -- =============================================
    -- ylb:1,备忘录表
    -- =============================================
    create table Memorandum
    (
    memorandum_id uniqueidentifier primary key,    --编号【UI,PK】
    subject varchar(200),    --主题
    tag varchar(200),    --标签
    target varchar(200),    --归属目标
    content varchar(2000),    --内容
    pubdate datetime default(getdate()),    --发布时间
    category_id uniqueidentifier references Category(category_id)    --分类编号(分类表)【FK】
    )
    
    GO
    -- =============================================
    -- ylb:1,备忘录关系表
    -- =============================================
    create table MemorandumRelation
    (
    type varchar(200),    --类型 tag:标签;attachment:附件
    memorandumRelation_id uniqueidentifier,    --编号
    memorandum_id uniqueidentifier references Memorandum(memorandum_id)--备忘录编号(备忘录表)【FK】
    )
    View Code

    1.B.2,

    1.C,功能实现代码(Function Implementation Code)返回顶部
    warn 作者:ylbtech
    出处:http://ylbtech.cnblogs.com/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    中共中央办公厅的机构设置(局、室)
    清理winsxs文件夹(系统更新文件)的第三方工具
    通用的MIME类型:application/octet-stream
    “IIS7.5无法写入配置文件web.config”的解决方案
    刷新组策略的命令
    windows网络和共享中心“查看基本网络信息并设置连接”为“未知”的解决方案
    使 windows 无需输入开机密码自动进入系统
    windows server 2008 R2 的 FTP 防火墙的正确配置方法
    搜狗浏览器不能使用拖拽搜索的解决方案
    无法启动 Diagnostic Policy Service(服务错误 1079)的解决方案
  • 原文地址:https://www.cnblogs.com/ylbtech/p/4195629.html
Copyright © 2011-2022 走看看