Results 1 to 6 of 6

Thread: Need Help

  1. #1
    Join Date
    Oct 2013
    Posts
    3

    Unanswered: Need Help

    Can anyone help me create a database design for gun inventory i dont know how to start because i have no idea what should i put.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    A gun inventory is not that different to any other form of inventory.

    persons own stuff.
    stuff can be categorised by types.
    stuff on hand can be calculated at any one time by taking note of transactions identifying those which add and those that reduce the stock of stuff.

    if you genuinely dont' have an idea of waht you should put then I'd suggest you back to basics
    examine the problem
    draw up an ER diagram
    think about what you need to cover (the business rules)
    design and develop your system using the principles of normalisation and relqtional theory


    what have you got so far?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Oct 2013
    Posts
    3
    still dont have an er diagram. coz i dont know what should i name in my tables.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Homework assignment.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by blindman View Post
    Homework assignment.
    Clearly

    However there is no law against pointing out which part of the classes the OP skipped
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Start with the post of healdem. I second his opinion.

    You only have to do "gun inventory", not sales, not billing, not employee or customer management, not even a "gun shop inventory" with not only guns but also bullets, gunpowder, clothes, knives, ... So your problem is very limited.

    I assume you have to make the inventory database design to manage the gun inventory of a museum, a gun collector, ...

    Start by identifying the object types (entities) you want to store: Rifle, Pistol, Airgun, ...
    Now per type, write down the things (attributes) you want to store about them: brand, type, purchase_price, purchase_date, purchased_from, nozzle size, construction year, serial number, number in stock,...

    You will notice that some attributes are the same for multiple entities, like brand and price. Put those in a separate type (like Weapon) and remove them from the other entities. You have just found a supertype/subtype relationship: a rifle IS A weapon, an airgun IS A weapon, a pistol IS A weapon. Draw a line between Rifle and Weapon, Airgun and Weapon, ...

    You will notice that many weapons have the same brand, create an entity Brand. A Weapon record will point to one record in the Brand table, you will later enforce that with a FOREIGN KEY constraint in the database.

    Imagine that you are using this system to look for a gun. What are the parameters you would like to use to search for a gun? Price (range), brand, type, freely available/official papers needed, number available, bullets fired/minute, .... those are the attributes you will have to add to the entities. When you expect a listbox for certain parameters, create a separate entity to store those values, like Brand.

    Hope this gets you started.

    We don't do people's homework here, but we are willing to help you if you show us that you have put effort in it yourself. If you're stuck, show us what you got so far and we will help you.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •