I know a bit of sql but not enough for this task, thats why the title question might seem a bit weird. =P
I have some tables like the following (a lot of data stripped for space)
**Consoles**
id INT
console VARCHAR
**Games**
id INT
console_id INT
game VARCHAR
**Categories**
id INT
category VARCHAR
**Categories_Games**
id INT
category_id INT
game_id INT
Categories_Games being the join table.
Now, I manually added to the system categories to all registered games of a console.
Before I start the tedious job of repeating the task for another console, what I need to know is: Is there a way to copy the registered categories from one console to another where the game is the same?
Most likely it is possible but I’m failing to figure.
Edit. clarifying.
I have all games registered already. (For instance, I have ‘street fighter 4’ for ps3, and ‘street fighter 4’ for xbox.
I have categories for all games associated to one console (ps3).
I want all xbox games to have the same categories ps3 games already have if the game’s name is the same.
In your model, categories are related to games, not to consoles. Games are related to consoles. Do you want to copy the game from one console to the other? Assuming that id are AUTO_INCREMENT, and you want to copy the xbox games to wii games, try this:
Based on your clarification, do this: