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 8489985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:58:47+00:00 2026-06-10T21:58:47+00:00

I know a bit of sql but not enough for this task, thats why

  • 0

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.

  • 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-10T21:58:49+00:00Added an answer on June 10, 2026 at 9:58 pm

    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:

    insert into consoles(console) values('wii');
    
    insert into games(console_id,game)
    select wii.id,g.game
    from games g
    join consoles x
    on x.console_id = g.console_id
    join consoles wii
    on wii.console = 'wii'
    where x.console = 'xbox';
    

    Based on your clarification, do this:

    insert into categories_games(category_id,game_id)
    select cg.category_id,other_game.game_id
    from games ps3_game
    join console ps3
      on ps3.console = 'ps3'
      and ps3.console_id = ps3_game.console_id 
    join categories_games cg
      on cg.game_id = ps3_game.game_id
    join games other_game 
      on  other_game.game = ps3_game.game
      and other_game.console_id <> ps3_game.console_id;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know a little bit of regex, but not mutch. What is the best
I know this is bit of a strange one but if anyone had any
Firstly, this DB question could be a bit DB agnostic, but I am using
Ok guys I know this question has been asked before but I am very
I know a little bit about Object Oriented design , but I'm not sure
I know a bit about assembly programming in Microchip PIC micro controllers, but I
Pretty confused right now, while i feel i know a bit about vhosts this
I know a little bit about TextWatcher but that fires on every character you
I am new to Perl, but I know a little bit of C though.
I have a bit of SQL that is almost doing what I want it

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.