I am pretty much a beginner having only created a few small php web applications relying on a MySQL database. I am now working on a somewhat larger project. I am in the planning stages of setting up the database and am having difficulty wrapping my mind around one issue.
The database will be used for Lego. The main tables will be parts and sets. Under the sets table I will require a listing of the part numbers that are in each set as well as a listing for the quantity of those parts in the set. My limited knowledge of how to set this up would see me setting up something like... part_1, part_2, part_3... etc & qty_1, qty_2, qty_3... etc. The problem with this is that there will be some sets that have hundreds of parts which makes the method I can think of unfeasibly messy. Also I would like to have the functionality for a user to be able to query the database and recover all sets that have a particular part. With the setup I have in mind I can't see this as possible as it would potentially require a search through 100+ columns.
I am sure there is a simple solution that my noobness cannot see and one which I cannot find online via the keyword searches I have been making (I am 4 hours into that search and have learned a lot but not what I wanted...). Any advice would be very greatly appreciated.
Apologies for not giving you code. The website will be done in PHP with a MySQL database. At the moment I am at the stage of drawings in a notebook and do not have anything coded down.