W
W
Webber2020-08-26 22:04:02
Database design
Webber, 2020-08-26 22:04:02

The structure of subcategories in the database?

There are groups with fields: id, key, name
A group can be linked to other groups. What is the correct way to implement this in the database?

Example:
- id:1, key: daily, name: Daily updates
-- id: 3, key: news, name: News
- id:2, key: weekly, name: Weekly updates
-- id: 3, key: news , name: News

Something is wrong:

groups: id, key, name
group_group: group_id, group_id

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton R., 2020-08-26
@anton_reut

Additional field parent_id. May be empty.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question