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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:31:04+00:00 2026-05-14T06:31:04+00:00

I have the following Tables: Players id playerName Weapons id type otherData Weapons2Player id

  • 0

I have the following Tables:

Players

  • id
  • playerName

Weapons

  • id
  • type
  • otherData

Weapons2Player

  • id
  • playersID_reference
  • weaponsID_reference

That was nice and simple.

Now I need to SELECT items from the Weapons table, according to some of their characteristics that i previously just packed into the otherData column (since it was only needed on the client side). The problem is, that the types have varying characteristics – but also a lot of similar data.

So I’m trying to decide on the following possibilities, all of which have their pros and cons.

Solution A

Kill the Weapons table, and create a new table for each Weapon-Type:

Weapons_Swords

  • id
  • bladeType
  • damage
  • otherData

Weapons_Guns

  • id
  • accuracy
  • damage
  • ammoType
  • otherData

But how will i Link these to the Players ?

  • create Weapons_Swords2Players, Weapons_Guns2Players for each weapon-type? (Will result in a lot more JOINS when loading the player with all his weapons…and it’s also more complicated to insert a new player)

or

  • add another column to Weapons2Players called WeaponsTypeTable, then do sub-selects to the correct Weapons sub-table (seems easier, but not really right, slightly easier insert i guess)

Solution B

Keep the Weapons table, and add all the fields i need to it. The Problem is that then there will be NULL fields, since not all Weapon-Types use all fields (can’t be right)

Weapons

  • id
  • type
  • accuracy
  • damage
  • ammoType
  • bladeType
  • otherData

This seems to be pretty basic stuff, but i just can’t decide what’s best. Or is there a correct Solution C?

  • 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-05-14T06:31:05+00:00Added an answer on May 14, 2026 at 6:31 am

    One solution is to create a master weapons table to which the Weapons_Swords and Weapons_Guns have foreign key references like so:

    Create Table Weapons
    {
        Id ...
        , ...
    }
    
    Create Table Weapons_Swords
    {
        Id...
        , ...
        , Constraint FK_Weapons_Swords_Weapons
            Foreign Key ( Id )
            References Weapons( Id )
    }
    Create Table Weapons_Guns
    {
        Id...
        , ...
        , Constraint FK_Weapons_Guns_Weapons
            Foreign Key ( Id )
            References Weapons( Id )
    }
    

    You would then have your standard PlayerWeapons table:

    Create Table PlayerWeapons
    {
        PlayerId ..
        , WeaponId ..
        , Constraint FK_PlayerWeapons_Players
            Foreign Key ( PlayerId )
            References Players( Id )
        , Constraint FK_PlayerWeapons_Weapons
            Foreign Key ( WeaponId )
            References Weapons( Id )
    }
    

    The downside to this approach is that you can have a weapon that does not point to a specific type and you do have additional joins. The upside is that you can add attributes common to all weapons into the Weapons table.

    Your solution b involves denormalizing the Weapons table. The advantage is that it is significantly simpler to get data and ensure that a weapons does not point to nothing.

    If the attributes of the various weapon types differ significantly, then I’d recommend creating a master weapons table. If there is a lot of similarities, then you could consider the denormalized solution. If I had no idea how much variance I would get, my inclination would be to make it as normalized as possible and thus use the master Weapons table.

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

Sidebar

Related Questions

Suppose that we have following tables create table Employee( 2 EMPNO NUMBER(3), 3 ENAME
I have a simple database that keeps track of transactions from multiple players in
I have the following defining a table: CREATE TABLE players(playerid INTEGER PRIMARY KEY AUTOINCREMENT
I have following tables questions -> id, question_data, user_id users -> id, fname, lname
I have the following tables: users +----------+----------+----------+ | id | name | dob |
I have the following tables in my database: Products ID_PRODUCT PRODUCTNAME PRICE Customers ID_CUSTOMER
I have the following tables. I want to run a query but I think
I have the following tables. I wanted it so when I make more boxes
I have the following tables in SQL Server 2005 ReceiptPoint: ID (PK), Name GasIndexLocation:
i have the following tables in sql server: photoalbumsTable: album_ID album_caption albumtagmap id album_id

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.