• ylbtech-cnblogs(博客园)-数据库设计-7,News(新闻)


    ylbtech-DatabaseDesgin:ylbtech-cnblogs(博客园)-数据库设计-7,News(新闻)

    DatabaseName:cnblogs(博客园)

    Model:News(新闻)数据设计

    Type:专业技术网站

    Url:http://www.cnblogs.com/

    1.A,数据库关系图(Database Diagram)

     

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

     B)7,sql-basic-news.sql

    use cnblogs
    go
    -- =============================================
    -- ylb:1, news-新闻
    -- =============================================
    create table News
    (
    newsId int primary key identity(1000,1),    --编号【PK,ID】
    title varchar(200),        --标题
    content text,        --内容
    author varchar(20),    --投稿人
    source_link varchar(100),    --来源地址
    source_name varchar(100),    --来源名称
    keyword varchar(100),        --关键词
    decription varchar(300),    --描述
    read_count int default(0),    --阅读次数
    comment_count int default(0),    --评论次数
    digg_num int default(0),        --推荐数量
    bury_num int default(0),        --反对数量
    pubdate datetime default(getdate()),    --发布时间
    state char(2),        --新闻状态 0:待处理;1:通过;2:驳回
    is_convert bit,        --全角/半角
    topic_img varchar(200),    --主题图片
    accountId int not null    --帐户编号【FK】关联与帐户设置
    )
    go
    -- =============================================
    -- ylb:1, news-评论表
    -- =============================================
    create table Comment
    (
    commentId int primary key identity(100,1),    --编号【PK,ID】
    content varchar(400),    --评论内容
    username varchar(20),    --昵称
    pubdate datetime default(getdate()),    --发布时间
    type varchar(2),    --类型 "0":新闻 1 随笔 2 文章
    newsId int not null,    --新闻编号【FK】关联与新闻表
    hostId int not null,    --帐户编号【FK】关联与帐户表 博主
    visitId int not null    --帐户编号【FK】关联与帐户表 访问者
    )
    View Code
    1.C,功能实现代码(Function Implementation Code)
    warn 作者:ylbtech
    出处:http://ylbtech.cnblogs.com/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    Problem of saving images in WPF (RenderTargetBitmap)zz
    巴特沃斯(Butterworth)滤波器 (2)
    巴特沃斯(Butterworth)滤波器 (1)
    vs发布的程序不依赖运行时库msvcp100.dll
    [leetcode]Word Search @ Python
    [leetcode]Merge Sorted Array @ Python
    [leetcode]Set Matrix Zeroes @ Python
    [leetcode]Restore IP Addresses @ Python
    [leetcode]Interleaving String @ Python
    [leetcode]Distinct Subsequences @ Python
  • 原文地址:https://www.cnblogs.com/ylbtech/p/3252433.html
Copyright © 2020-2023  润新知