内容------
功能列表:
 用户:
   登录、 
   注册、
   退出、
   修改资料、
   查看新闻,对新闻进行评论,加好友,查看好友近况。
管理员:
   登录、
   管理新闻信息、
   管理用户信息

解决方案 »

  1.   

    ms有个例子数据库 
    或者 你用express 创建一个数据库 再导出对应的sql 语句
      

  2.   

    create table users(userid int,username,userpower)
    create table friends(friendsid,userid)
    create table news(newsid,content)
    create table comm(newsid,userid,con)
      

  3.   


    Ⅰ工具相关PD 新建PhysicalDataModel
    → 菜单项(数据库) → 生成数据库 → 选择MS SQL 2005 ......Ⅱ脚本相关/*==============================================================*/
    /* DBMS name:      Microsoft SQL Server 2005                    */
    /* Created on:     2010-05-18 11:01:50                          */
    /*==============================================================*/
    if exists (select 1
       from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
       where r.fkeyid = object_id('tbl_Com') and o.name = 'tbl_Com_tbl_User_CommID')
    alter table tbl_Com
       drop constraint tbl_Com_tbl_User_CommID
    goif exists (select 1
       from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
       where r.fkeyid = object_id('tbl_Com') and o.name = 'tbl_Com_tbl_User_NewID')
    alter table tbl_Com
       drop constraint tbl_Com_tbl_User_NewID
    goif exists (select 1
       from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
       where r.fkeyid = object_id('tbl_FriendShip') and o.name = 'tbl_FriendShip_tbl_User_FriendUserID')
    alter table tbl_FriendShip
       drop constraint tbl_FriendShip_tbl_User_FriendUserID
    goif exists (select 1
       from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
       where r.fkeyid = object_id('tbl_FriendShip') and o.name = 'tbl_FriendShip_tbl_User_UserID')
    alter table tbl_FriendShip
       drop constraint tbl_FriendShip_tbl_User_UserID
    goif exists (select 1
                from  sysobjects
               where  id = object_id('tbl_Com')
                and   type = 'U')
       drop table tbl_Com
    goif exists (select 1
                from  sysobjects
               where  id = object_id('tbl_FriendShip')
                and   type = 'U')
       drop table tbl_FriendShip
    goif exists (select 1
                from  sysobjects
               where  id = object_id('tbl_New')
                and   type = 'U')
       drop table tbl_New
    goif exists (select 1
                from  sysobjects
               where  id = object_id('tbl_User')
                and   type = 'U')
       drop table tbl_User
    go/*==============================================================*/
    /* Table: tbl_Com                                               */
    /*==============================================================*/
    create table tbl_Com (
       CommID               int                  identity,
       NewID                int                  null,
       UserID               int                  null,
       CommContent          nvarchar(MAX)        null,
       CommDate             datetime             null,
       constraint PK_TBL_COM primary key (CommID)
    )
    go/*==============================================================*/
    /* Table: tbl_FriendShip                                        */
    /*==============================================================*/
    create table tbl_FriendShip (
       FriendShipID         int                  identity,
       UseID                int                  not null,
       FriendUseID          int                  null,
       IsActive             bit                  null,
       LoginTime            datetime             null,
       IsLocked             bit                  null,
       constraint PK_TBL_FRIENDSHIP primary key (FriendShipID)
    )
    go/*==============================================================*/
    /* Table: tbl_New                                               */
    /*==============================================================*/
    create table tbl_New (
       Newid                int                  identity,
       Column_2             nvarchar(30)         null,
       Column_3             nvarchr(MAX)         null,
       Column_4             datetime             null,
       Column_5             datetime             null,
       Column_6             nvarchar(20)         null,
       constraint PK_TBL_NEW primary key (Newid)
    )
    go/*==============================================================*/
    /* Table: tbl_User                                              */
    /*==============================================================*/
    create table tbl_User (
       UserID               int                  identity,
       UserName             nvarchar(20)         not null,
       gender               bit                  null,
       Address              varchar(32)          null,
       Phone                varchar(22)          null,
       IsAdmin              bit                  null,
       constraint PK_TBL_USER primary key (UserID)
    )
    goalter table tbl_Com
       add constraint tbl_Com_tbl_User_CommID foreign key (UserID)
          references tbl_User (UserID)
    goalter table tbl_Com
       add constraint tbl_Com_tbl_User_NewID foreign key (NewID)
          references tbl_New (Newid)
    goalter table tbl_FriendShip
       add constraint tbl_FriendShip_tbl_User_FriendUserID foreign key (FriendUseID)
          references tbl_User (UserID)
    goalter table tbl_FriendShip
       add constraint tbl_FriendShip_tbl_User_UserID foreign key (UseID)
          references tbl_User (UserID)
    go
      

  4.   

    --数据库建模工具SyBase的PowerDesigner 12