📒 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 name | explain |
---|---|
admin | Administrator table |
attention | Attention table |
category | category |
collect | Collection table |
comments | Comment form |
graphic | Graphic table |
history | History table |
likes | Praise form |
photos | Picture table |
t_group | Grouping table |
user | User table |
video | Video table |
Table name:
Description: administrator table
Data column:
Serial number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | username | varchar | 20 | 0 | N | N | ||
3 | password | varchar | 20 | 0 | N | N |
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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | Table id | |
2 | user_id | int | 10 | 0 | N | N | User id | |
3 | attention_user_id | int | 10 | 0 | N | N | Concerned 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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | cate_id | varchar | 50 | 0 | N | N | Class alias | |
3 | levels | varchar | 50 | 0 | N | N | level | |
4 | parent_id | int | 10 | 0 | N | N | Parent 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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | user_id | int | 10 | 0 | N | N | User id | |
3 | video_id | int | 10 | 0 | N | N | Video id | |
4 | collect_date | date | 10 | 0 | N | N | Collection 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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | user_id | int | 10 | 0 | N | N | User id | |
3 | sources_date | int | 10 | 0 | N | N | Commented resource id | |
4 | content_time | date | 10 | 0 | N | N | Comment time | |
5 | content | varchar | 250 | 0 | N | N | content | |
6 | parent_comment_id | int | 10 | 0 | N | N | Parent 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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | title | varchar | 250 | 0 | N | N | title | |
3 | brief | varchar | 250 | 0 | N | N | describe | |
4 | cover_path | varchar | 250 | 0 | N | N | Cover path | |
5 | category_id | int | 10 | 0 | N | N | Secondary category | |
6 | create_date | date | 10 | 0 | N | N | Release time | |
7 | user_id | int | 10 | 0 | N | N | User id | |
8 | like_count | int | 10 | 0 | N | N | Like 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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | user_id | int | 10 | 0 | N | N | User id | |
3 | video_id | int | 10 | 0 | N | N | Video id | |
4 | history_date | date | 10 | 0 | N | N | time |
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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | user_id | int | 10 | 0 | N | N | User id | |
3 | like_date | date | 10 | 0 | N | N | Like time | |
4 | video_id | int | 10 | 0 | N | N | Like 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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | photo_path | varchar | 50 | 0 | N | N | pictures linking | |
3 | graphic_id | int | 10 | 0 | N | N | Graphic 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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | title | varchar | 50 | 0 | N | N | title | |
3 | create_date | date | 10 | 0 | N | N | Creation time | |
4 | user_id | int | 10 | 0 | N | N | User id | |
5 | video_num | int | 10 | 0 | N | N | Number 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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | phone | varchar | 50 | 0 | N | N | cell-phone number | |
3 | username | varchar | 50 | 0 | N | N | user name | |
4 | head_img | varchar | 50 | 0 | Y | N | head portrait | |
5 | brief | varchar | 50 | 0 | Y | N | brief introduction | |
6 | varchar | 50 | 0 | Y | N | |||
7 | create_date | date | 10 | 0 | N | N | Registration time | |
8 | fans_count | int | 10 | 0 | N | N | Number of fans | |
9 | video_count | int | 10 | 0 | N | N | Number of videos and pictures | |
10 | score | int | 10 | 0 | N | N | credit |
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 number | name | data type | length | Decimal places | Null value allowed | Primary key | Default value | explain |
---|---|---|---|---|---|---|---|---|
1 | id | int | 10 | 0 | N | Y | ||
2 | title | varchar | 50 | 0 | N | N | title | |
3 | description | varchar | 250 | 0 | N | N | describe | |
4 | cover_path | varchar | 250 | 0 | N | N | Cover link | |
5 | video_path | date | 10 | 0 | N | N | Video link | |
6 | create_date | int | 10 | 0 | N | N | Release time | |
7 | category_id | int | 10 | 0 | N | N | Secondary category id | |
8 | user_id | varchar | 20 | 0 | N | N | User id | |
9 | group_id | int | 10 | 0 | N | N | Packet id | |
10 | like_count | int | 10 | 0 | Y | N | Like times | |
11 | oppose_count | int | 10 | 0 | Y | N | Playback 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;