A
A
Andrew2015-11-03 12:31:37
Database
Andrew, 2015-11-03 12:31:37

How are tags organized on websites?

Hello, could you explain how the tags are organized on the sites?
For example, there is an "article" that has several tags,
how is this tagged article stored in the database?
For each tag, a separate table is created in which information about "articles" is stored?
Or is there a general table where each "article" entry has information about tags?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Grechushnikov, 2015-11-03
@maxyc_webber

there is a table of articles
there is a table of tags
there is a link table that combines tags and articles
search in Google by query Databases many-to-many relationships, crosstabs

O
Omich, 2015-11-03
@omichkun

This is usually done using a many-to-many relationship. That is, there are two tables - one with tags, the second with articles. And there is a third one - a linking table, in which article IDs are compared with tag IDs.

I
Ivan, 2015-11-03
@iwqn

there is a general table where each entry of the "article" contains information about tags
for each tag according to the table do this from a sparrow cannon

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question