⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bbs数据库创建脚本.sql

📁 简单的JSP论坛                      
💻 SQL
字号:
/*==============================================================*/
/* Database: bbs                                                */
/*==============================================================*/
/*drop database if exists bbs;

create database bbs;
*/
use bbs;

/*==============================================================*/
/* DBMS name:      MySQL 4.0                                    */
/* Created on:     2007-6-28 15:25:46                           */
/*==============================================================*/

drop table if exists admin;

drop table if exists note;

drop table if exists subitem;

drop table if exists item;

drop table if exists user;

/*==============================================================*/
/* Table: admin                                                 */
/*==============================================================*/
create table admin
(
   id							  INT			  AUTO_INCREMENT 			PRIMARY KEY ,
   adminid                        VARCHAR(50)                    not null,
   adminpwd                       VARCHAR(50)
) ;

/*==============================================================*/
/* Table: note                                                  */
/*==============================================================*/
create table note
(
   id                             int             auto_increment               not null,
   title                          VARCHAR(50),
   content                        text,
   itemid                         int,
   subid                          int,
   userid                         VARCHAR(50),
   pid                            int,
   rid                            int,
   createtime                     datetime,
   replytime                      datetime,
   changetime                     datetime,
   clickcount                     int,
   replycount                     int,
   primary key (id)
) ;

/*==============================================================*/
/* Table: item                                                  */
/*==============================================================*/
create table item
(
   itemid                         int             auto_increment               not null,
   itemname                       VARCHAR(50),
   itemcode                       int,
   primary key (itemid)
) ;


/*==============================================================*/
/* Table: subitem                                               */
/*==============================================================*/
create table subitem
(
   subid                          int              auto_increment              not null ,
   subname                        varchar(50),
   itemid                         int,
   subcode                        int,
   subinfo						  text,
   clickcount                     int,
   motif                          int,
   notecount                      int,
   replytime                      datetime,
   primary key (subid) ,
   foreign key (itemid) references item(itemid) on delete cascade
) ;

/*==============================================================*/
/* Table: user                                                  */
/*==============================================================*/
create table user
(
   id				 			  INT		       AUTO_INCREMENT 				PRIMARY KEY ,
   userid                         VARCHAR(50)                  not null ,
   userpwd                        VARCHAR(50),
   userques                       VARCHAR(50),
   userans                        VARCHAR(50),
   usermail                       VARCHAR(50),
   realname                       VARCHAR(50),
   createtime 				      datetime,
   replycount					  int
) ;
/*==============================================================*/
/* 创建默认的admin用户                                          */
/*==============================================================*/
insert into admin(adminid,adminpwd) value('root','root');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -