473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Advice wanted on Data Structure

I have a question that I hope I can explain well enough:

I am trying to figure out a data structure for an inventory system. The
system contains:

Items
Kits (Made from a collection of Items and/or other Kits)

Now my question is:

Is there any way to structure this in a database so that I could run a
single query to get the contents of a kit, even though it contains other
kits?

My problems occur when I try to create the tables as so:

ITEMS: KIT_CONTENTS KITS
KIT_ID<---------------->KIT_ID
ITEM_ID<--------->ITEM_ID Description
Description
Price
Etc

The only way I could think of to allow a kit to be contained within a kit:

Add another field to KIT_CONTENTS called Sub_Kit

Which seems like a dumb way of doing it, because first of all, most kits
don't have sub kits, so that would be a wasted field in most cases.
Secondly, as far as I know the application logic would have to do multiple
queries's to get the sub_kits.

I really hope there is a simple and more logical way to do this, preferably
allowing me to run a SINGLE query that will show a kit with all its sub
kits. Otherwise I would need to have repeated queries from the application
logic, and I really want to avoid that.

Please help, thanks.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1048

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

75
by: Howard Nease | last post by:
Hello, everyone. I would appreciate any advice that someone could give me on my future career path. Here is my situation: I am a bright Junior in a very well-respected private high school, taking...
0
by: Donald Tyler | last post by:
I have a question that I hope I can explain well enough: I am trying to figure out a data structure for an inventory system. The system contains: Items Kits (Made from a collection of Items...
0
by: Mark Stokes | last post by:
Hi there, I wanted a bit of advice on a program (a prototype) that I am trying to write that uses threads. I will outline what I am attempting to do, and if anyone has any advice on the way I...
11
by: Capstar | last post by:
Hi, I am working on an application, which will run embedded without an OS. The app is build up out of a couple of well defined parts. At first I wanted to keep those parts seperated and use...
3
by: Sigmathaar | last post by:
Hi, I'm need some advice about lists and vectors. I'm doing a program who needs to have sequential access of a non ordered unit of objects whose size decreases almost each time the sequence is...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
6
by: Mudcat | last post by:
Hi, I am trying to build a tool that analyzes stock data. Therefore I am going to download and store quite a vast amount of it. Just for a general number - assuming there are about 7000 listed...
2
by: mirandacascade | last post by:
Situation is this: 1) I have inherited some python code that accepts a string object, the contents of which is an XML document, and produces a data structure that represents some of the content of...
23
by: JohnH | last post by:
I'm just recently come to work for an auto brokerage firm. My position involves performing mysterious rites, rituals and magick in order to get information out of their access database. This is...
3
by: RgeeK | last post by:
A project I'm thinking about, could use some advice from those who understand the dimensional limits of an SQL-like DB. Imagine, for example, a database containing detailed data for many cities...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.