Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7994069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:02:22+00:00 2026-06-04T14:02:22+00:00

So, I am modeling a database using MySQL Workbench. I have a table called

  • 0

So, I am modeling a database using MySQL Workbench. I have a table called Category (two fields, id and description) and a table called Event. I would like to have a column in Event that holds any number of ids from Categories (as CSV, and their order is important).
How do I represent this in MySQL Workbench (in a ER model, I mean)? Or I am doing this really wrong?

It’ll look something like this:

| ID | Descripion
|  1 | Lorem...
|  2 | Ipsum...
|  3 | Dolor...
|  4 | Sit...
|  5 | Amet...


| ID | Name   | Categories
|  1 | John   | 2,1,5,4
|  2 | Reese  | 3,5,4
|  3 | Ben    | 1,5
|  4 | Linus  | 3,4,2
|  5 | Jack   | 5
|  6 | Lemon  | 4,5,2

(I’ve already read this: How to structure "categories" data in the database? but I am not sure I am in the same situation. My categories are more like a ‘tree’ than tags…)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:02:23+00:00Added an answer on June 4, 2026 at 2:02 pm

    For a many – many relationship you need an intermediate table which holds id’s from both tables you’re creating the relation between. On this table you can also set an ordering column which indicate how to sort your category.

    | ID_Event | ID_Cat | Order
    | 1        | 1      | 2000 
    | 1        | 2      | 1000
    | 1        | 5      | 3000
    | 1        | 4      | 4000 
    

    and so on.

    You can choose to leave a nice gap in your ordering column by a 1000+ values so you can easily put in categories between existing ordered items.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming you were modeling a Q&A database using MySQL, I am aware of two
I have a MySQL database and would like to have a similar structure in
I'm modeling my db shema using MySQL Workbench CE EER modeler and now I'm
I have a general question regarding table indices on foreign keys in database modeling.
I'm modelling MySQL database for an website. I'm now making 'people' table, and deciding
I have a modeling question related to profiles. Firstly, I have looked into using
What are the standard notations in database modeling. Visio offer two types, The crow
In my database I have a table 'favorites' and a table 'activity'. I am
This is somewhat a continuation of Database Modeling: Facebook like messages . I'm trying
I would like to query a relational database if a set of items exists.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.