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/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    spring boot入门程序获取自定义配置文件内的参数并返回json数据的错误案例1
    MIME媒体类型
    浏览器重排和重绘——JavaScript之DOM性能优化
    ECMAScript 5 浏览器兼容性列表
    浏览器性能分析
    JS函数调用方式
    document.body is null
    动态JavaScript技术总结
    网站下载时间快慢带来的影响
    JavaScript好文推荐(持续更新)
  • 原文地址:https://www.cnblogs.com/ylbtech/p/4195629.html
Copyright © 2011-2022 走看看