码迷,mamicode.com
首页 > 数据库 > 详细

随时随地笔记“好学”全程实践(三)- 数据库设计

时间:2015-09-05 06:34:57      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

   

关系图

技术分享

建表SQL

CREATE TABLE Hx_Author (
    Id uniqueidentifier NOT NULL,
    UserName nvarchar(256) NOT NULL,
    AuthorName nvarchar(256) NOT NULL,
    Password nvarchar(50) NOT NULL,
    PasswordSalt nvarchar(50) NOT NULL,
    Face nvarchar(500),
    Signature nvarchar(500)
);

CREATE TABLE Hx_Link (
    Id uniqueidentifier NOT NULL,
    Title nvarchar(256) NOT NULL,
    Link nvarchar(500) NOT NULL,
    AuthorId uniqueidentifier NOT NULL,
    CreateTime datetime DEFAULT GETDATE() NOT NULL,
    ModifyTime datetime DEFAULT GETDATE() NOT NULL
); 

CREATE TABLE Hx_Article (
    Id uniqueidentifier NOT NULL,
    Title nvarchar(256) NOT NULL,
    Summary nvarchar(500) NOT NULL,
    ArticleContent ntext NOT NULL,
    AuthorId uniqueidentifier NOT NULL,
    CategoryId uniqueidentifier NOT NULL,
    ReadCount int DEFAULT 0 NOT NULL,
    CommentCount int DEFAULT 0 NOT NULL,
    CreateTime datetime DEFAULT GETDATE() NOT NULL,
    ModifyTime datetime DEFAULT GETDATE() NOT NULL,
    Status bit DEFAULT 1 NOT NULL
); 

CREATE TABLE Hx_Quote (
    Id uniqueidentifier NOT NULL,
    AuthorId uniqueidentifier NOT NULL,
    QuoteContent nvarchar(500) NOT NULL,
    CreateTime datetime DEFAULT GETDATE() NOT NULL,
    ModifyTime datetime DEFAULT GETDATE() NOT NULL
);

CREATE TABLE Hx_Author (
    Id uniqueidentifier NOT NULL,
    UserName nvarchar(256) NOT NULL,
    AuthorName nvarchar(256) NOT NULL,
    Password nvarchar(50) NOT NULL,
    PasswordSalt nvarchar(50) NOT NULL,
    Face nvarchar(500),
    Signature nvarchar(500)
);

 

随时随地笔记“好学”全程实践(三)- 数据库设计

标签:

原文地址:http://www.cnblogs.com/kevinchoi/p/4782671.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!