In this case, it is better to create a table in mysql.

Source: Internet
Author: User
In this case, it is better to create a table in mysql: a user can subscribe to multiple emails and the functions required are as follows: A user can obtain the Mail type subscribed by this user. I can query the Mail type to find out which users have subscribed to this mail. how can I create a table? & nbsp; my idea is to create a user subscription table and a mail table. a field in the user subscription table stores all the email IDs subscribed to by this user & nbsp; however, in this case, it is better to create a table in mysql.
Condition: A user can subscribe to multiple emails.

The required functions are as follows:
A user can obtain the Mail type subscribed by this user.
I will query a mail type to find out which users have subscribed to this mail.

In this case, it is more appropriate to create a table.
My idea is to create a user subscription table and a mail table.
In the user subscription table, a field stores all the email IDs subscribed by the user.


But there is a problem.
Check this user so that you can easily know the type of the user subscription.
If you want to check the mail type, it is troublesome to query which users have subscribed to this mail.

Do you have any good ideas about table creation?

------ Solution --------------------
Three tables can be created;
1 User table;
A Mail category table;
Subscribe to The Mail record table in a user;
This operation and expansion are both convenient.
------ Solution --------------------
Three tables:
User table, email table, and user subscription table
The first two you know
The user subscription table has two fields: user id and email id.
From the field name, you should know how to do it.

------ Solution --------------------
You can use fuzzy search, regular expression, or other methods to query types.

Otherwise, what if there are 0.1 million categories (this is not a large number and there are more newsgroups than this?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.