The Design of the column about articles in the Field of MySQL Database

We have a news APP, with news and video columns, or corresponding website columns, these columns are different. It is expected that an article or video is placed in a table, and the column page is placed in a table. Where:

1. The column table uses a field to distinguish whether the column is website, APP video, or APP news.
2. Use a field in the content table to distinguish between video and news. The
menu column table may be as follows:

contentAPP"" "" content
content:

now, what kind of field do I need to add to my content to indicate which column my news or video belongs to (it may belong to multiple columns at the same time)? it is expected that there may be a varchar field channel, for example, the saved value of "1Person3Mague 5" indicates that it belongs to these columns, but in this case, it may not be very convenient for later retrieval, because content often has to search, and you can only use like fuzzy search. Do you have any good ideas? thank you for your advice!

Apr.12,2021

if you are not allowed to use only two tables, the normal operation of a many-to-many relationship should be to store another table.
for example, add a tag table to establish a relationship between menu.id and content.id .

in this way, you can do one more step of table join when you use it


can be expressed in bits. An int can express 32 columns,
for example

SELECT * FROM content WHERE `type`=POW(2,0)|POW(2,2)

you can find out the news belonging to column 1BI 3

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c02e-2ba58.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c02e-2ba58.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?