~cpp book |
bookid | isbn | totalpoint | title |
~cpp BtoBRel |
uid | bookid | relbookid | relpoint |
~cpp UtoBRel |
uid | bookid | userid | viewpoint | hviewpoint | lviewpoint |
puser |
userid | password | name |
review |
uid | regdate | bookid | userid | title | contents |
~cpp DataBase Create Query for MySQL
~cpp
CREATE TABLE IF NOT EXISTS BtoBRel(
uid int (11) NOT NULL auto_increment,
bookid varchar(12) NOT NULL DEFAULT '',
relbookid varchar(12) NOT NULL DEFAULT '',
relpoint int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (uid)
);
CREATE TABLE IF NOT EXISTS UtoBRel(
uid int (11) NOT NULL auto_increment,
userid varchar(12) NOT NULL DEFAULT '',
bookid varchar(12) NOT NULL DEFAULT '',
viewpoint int(11) NOT NULL DEFAULT 0,
hviewpoint int(11) NOT NULL DEFAULT 0,
lviewpoint int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (uid)
);
CREATE TABLE IF NOT EXISTS book(
bookid varchar(12) NOT NULL DEFAULT '',
isbn varchar(10) NOT NULL DEFAULT '',
totalpoint int(11) NOT NULL DEFAULT 0,
title varchar(40) NOT NULL DEFAULT '',
PRIMARY KEY (bookid)
);
CREATE TABLE IF NOT EXISTS puser(
userid varchar(16) NOT NULL DEFAULT '',
password varchar(8) NOT NULL DEFAULT '',
name varchar(8) NOT NULL DEFAULT '',
PRIMARY KEY(userid)
);
CREATE TABLE review(
uid int (11) NOT NULL auto_increment,
regdate datetime,
bookid varchar(12) NOT NULL DEFAULT '',
userid varchar(16) NOT NULL DEFAULT '',
title varchar(40) NOT NULL DEFAULT '',
contents text NOT NULL DEFAULT '',
PRIMARY KEY(uid)
);