Should learn App database table design document

📒 Programmer Xiao Wang's blog: Programmer Xiao Wang's blog
🎉 Welcome to praise 👍 Collection ⭐ Leaving a message. 📝
😊 If you have an editor's error and contact the author, if you have a good article, welcome to share it with me, I will extract the essence and discard the dross.
🍅 Learning route of java self-study: Learning route of java self-study

Yingxue APP is a software specially used for it knowledge education and sharing. It has a lot of professional IT knowledge teaching. Users interested in it can learn very professional knowledge on it.


be careful:
Before reading the App database table design document
It is suggested to look at: Demand analysis of learning App

Database name: yingxue

Document version: v1.0 zero

Document description: you should learn the design description of App database table

Table nameexplain
adminAdministrator table
attentionAttention table
categorycategory
collectCollection table
commentsComment form
graphicGraphic table
historyHistory table
likesPraise form
photosPicture table
t_groupGrouping table
userUser table
videoVideo table

Table name:

Description: administrator table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2usernamevarchar200NN
3passwordvarchar200NN
ROP TABLE IF EXISTS `admin`;

CREATE TABLE `admin`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Note: attention table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NYTable id
2user_idint100NNUser id
3attention_user_idint100NNConcerned user id
DROP TABLE IF EXISTS `attention`;

CREATE TABLE `attention`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `attention_user_id` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: Category

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2cate_idvarchar500NNClass alias
3levelsvarchar500NNlevel
4parent_idint100NNParent id
DROP TABLE IF EXISTS `category`;


CREATE TABLE `category`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `cate_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `levels` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `parent_id` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: collection table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2user_idint100NNUser id
3video_idint100NNVideo id
4collect_datedate100NNCollection time
DROP TABLE IF EXISTS `collect`;

CREATE TABLE `collect`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `video_id` int NOT NULL,
  `collect_date` date NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Note: comment form

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2user_idint100NNUser id
3sources_dateint100NNCommented resource id
4content_timedate100NNComment time
5contentvarchar2500NNcontent
6parent_comment_idint100NNParent comment id
DROP TABLE IF EXISTS `comments`;

CREATE TABLE `comments`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `sources_date` int NOT NULL,
  `content_time` date NOT NULL,
  `content` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `parent_comment_id` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: graphic table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2titlevarchar2500NNtitle
3briefvarchar2500NNdescribe
4cover_pathvarchar2500NNCover path
5category_idint100NNSecondary category
6create_datedate100NNRelease time
7user_idint100NNUser id
8like_countint100NNLike times
DROP TABLE IF EXISTS `graphic`;

CREATE TABLE `graphic`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `brief` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `cover_path` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `category_id` int NOT NULL,
  `create_id` int NOT NULL,
  `user_id` int NOT NULL,
  `like_count` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: history table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2user_idint100NNUser id
3video_idint100NNVideo id
4history_datedate100NNtime
DROP TABLE IF EXISTS `history`;

CREATE TABLE `history`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `video_id` int NOT NULL,
  `history_date` date NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: praise form

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2user_idint100NNUser id
3like_datedate100NNLike time
4video_idint100NNLike video id
DROP TABLE IF EXISTS `likes`;

CREATE TABLE `likes`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `like_date` date NOT NULL,
  `video_id` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: picture table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2photo_pathvarchar500NNpictures linking
3graphic_idint100NNGraphic id
DROP TABLE IF EXISTS `photos`;

CREATE TABLE `photos`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `photo_path` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `graphic_id` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: grouping table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2titlevarchar500NNtitle
3create_datedate100NNCreation time
4user_idint100NNUser id
5video_numint100NNNumber of videos
DROP TABLE IF EXISTS `t_group`;

CREATE TABLE `t_group`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `create_date` date NOT NULL,
  `user_id` int NOT NULL,
  `video_num` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: user table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2phonevarchar500NNcell-phone number
3usernamevarchar500NNuser name
4head_imgvarchar500YNhead portrait
5briefvarchar500YNbrief introduction
6wechatvarchar500YNWeChat
7create_datedate100NNRegistration time
8fans_countint100NNNumber of fans
9video_countint100NNNumber of videos and pictures
10scoreint100NNcredit
DROP TABLE IF EXISTS `user`;

CREATE TABLE `user`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `phone` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `username` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `head_img` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `brief` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `wechat` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `create_date` date NOT NULL,
  `fans_count` int NOT NULL,
  `video_count` int NOT NULL,
  `score` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Table name:

Description: video table

Data column:

Serial numbernamedata typelengthDecimal placesNull value allowedPrimary keyDefault valueexplain
1idint100NY
2titlevarchar500NNtitle
3descriptionvarchar2500NNdescribe
4cover_pathvarchar2500NNCover link
5video_pathdate100NNVideo link
6create_dateint100NNRelease time
7category_idint100NNSecondary category id
8user_idvarchar200NNUser id
9group_idint100NNPacket id
10like_countint100YNLike times
11oppose_countint100YNPlayback times
DROP TABLE IF EXISTS `video`;

CREATE TABLE `video`  (
  `vedio_id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `description` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `cover_path` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `video_path` date NOT NULL,
  `create_date` int NOT NULL,
  `category_id` int NOT NULL,
  `user_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `group_id` int NOT NULL,
  `like_count` int NULL DEFAULT NULL,
  `oppose_count` int NULL DEFAULT NULL,
  PRIMARY KEY (`vedio_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

Keywords: Database

Added by abhi201090 on Tue, 28 Dec 2021 23:19:32 +0200