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

  • Home
  • SEARCH
  • 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 9163459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:27:11+00:00 2026-06-17T14:27:11+00:00

So to my knowledge there is no sets, lists, dicts, or arrays in mysql.

  • 0

So to my knowledge there is no sets, lists, dicts, or arrays in mysql. I want to build a system that has two core components, information about a game match, and then a list of the characters played in the match. If there were lists in mysql then I would do something like this:

game_id INT,
characters list<varchar>,
....more data

The basic query that I want to be able to do is something like this:

SELECT * FROM games WHERE characters IN LIST(list);

Its possible I may select with only one character, or i may specify 10 characters. The question is how to do this efficiently in mysql versus using 10 WHERE clauses with OR. There is also no specific ordering to the characters…but I suppose I could order them based on their IDs.

The only way I have thought of doing this nicely is creating the first table with the basic information and a second table with just character ids and the game_id.

Anyone have a suggestion on how to organize this data nicely with some fancy mysql tricks that I may not know about? The queries need to be fast too, as there will probably be a lot of them eventually. It will be way more reads than writes unless I add a view/download counter….than i guess it will be more writes/updates than reads.

Thanks and I am happy to give anymore information.

  • 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-17T14:27:12+00:00Added an answer on June 17, 2026 at 2:27 pm

    Two ways I can think of, if I understand your question correctly….

    METHOD 1 … adding a game_characters table that looks like …

    CREATE TABLE `games_characters` (
      `game_id` int(11) DEFAULT NULL,
      `character_id` int(11) DEFAULT NULL,
      KEY `games` (`game_id`),
      KEY `characters` (`character_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    

    … then the query would be something like …

    SELECT *
    FROM `games` as g
    LEFT JOIN `games_characters` as gc
      ON (g.`id` = gc.`game_id`)
    WHERE gc.`character_id` IN (12,52,86,23)
    

    METHOD 2 … using LIKE, less ideal for large databases, but avoids an extra table … the characters record would contain a bunch of ids from another table, characters, delimited by a period like so “.23.51.252.75.93.”. The query would look like

    SELECT *
    FROM `games`
    WHERE `characters` LIKE '%.23.%'
       OR `characters` LIKE '%.58.%'
    

    Your CMS would have to parse and rebuild the string.

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

Sidebar

Related Questions

I know that there are two methods of submitting a form: 'GET' and 'POST'.
Is there a built-in predicate or a easy way to remove from the knowledge
There seems to be quite a bit of folklore knowledge floating about in restricted
There doesn't seem to be (to my knowledge) an API to edit Google Docs
As per my knowledge, there are 3 methods to compile and use C code
It seems when I grab some hierarchical ActiveRecord structure that there are quite a
GPUs have become more and more general purpose over the last decade. There has
Is there any framework or platform that is providing message exchange in reliable, flexible,
Recently I've decided to get some knowledge about writing custom tags. And there is
I want to set the layout in a android app so that a edit

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.