Skip navigation links

MySQL Forums :: Database Design & Data Modelling :: Simple Database Design Problem


Advanced Search

Re: Simple Database Design Problem
Posted by: Filip Nedyalkov ()
Date: June 11, 2011 04:56PM

Ok thanks for the advices on that matter.

I would like to ask one more thing.

From table templates, each template can have many components (table components). It's like one to many relation - not a problem here.

But here is my wondering:
Things work like this. First the user installs components, so each component goes in the components table under component_id: 1,2 etc.

After the user has finished installing the components, they go to install the templates that use that components. So the questions I have here are:
1) When you insert the template data how will it recognize which are the component_ids that belong to it? (have in mind that the user builds the template with that components, so he knows which components the template includes, the problem is how to identify them when installing the template?)

Solution: here as a solution I thought that setting an unique identifier for each component like component_name for example would be enough for the template to get the id of the component that belongs to it. Does that sound good?

2) When you insert some data in a row in a table, can you get the id of that row you just inserted? If I am able to do that then I could write a script that installs the components and gets their ids and then installs the template and sets the components ids it uses. Of course a flaw in this approach is that I could do that only with the first install. If I already have the components installed and just want to install the template I won't know their ids... so I guess that's not good.

In summary:
I would like not to make the user go and install first the components and then manually trying to identify them and add them to the template when he installs it. But more like a script that first installs the components (rows in a table) and then installs the templates that can auto identify which components from the component table belong to it and write down that component ids for it. Presumably here I suggested that I would pass the unique components names when searching the components table and add their ids to the template in question.

So thoughts ?

Options: ReplyQuote


Subject Written By Posted
Simple Database Design Problem Filip Nedyalkov 06/09/2011 08:49AM
Re: Simple Database Design Problem Rick James 06/10/2011 11:48PM
Re: Simple Database Design Problem Filip Nedyalkov 06/11/2011 02:04AM
Re: Simple Database Design Problem Filip Nedyalkov 06/11/2011 02:07AM
Re: Simple Database Design Problem Rick James 06/11/2011 09:18AM
Re: Simple Database Design Problem Filip Nedyalkov 06/11/2011 04:56PM
Re: Simple Database Design Problem Rick James 06/11/2011 09:46PM
Re: Simple Database Design Problem Filip Nedyalkov 06/12/2011 03:23AM
Re: Simple Database Design Problem Rick James 06/12/2011 09:01PM
Re: Simple Database Design Problem Filip Nedyalkov 06/13/2011 03:04AM
Re: Simple Database Design Problem Rick James 06/13/2011 10:33AM
Re: Simple Database Design Problem Filip Nedyalkov 06/13/2011 04:53PM
Re: Simple Database Design Problem Rick James 06/13/2011 08:42PM
Re: Simple Database Design Problem Filip Nedyalkov 06/14/2011 03:28AM
Re: Simple Database Design Problem Rick James 06/14/2011 08:09PM
Re: Simple Database Design Problem Filip Nedyalkov 06/15/2011 02:22AM
Re: Simple Database Design Problem Filip Nedyalkov 06/15/2011 06:15AM
Re: Simple Database Design Problem Rick James 06/15/2011 07:31PM
Re: Simple Database Design Problem Sachin Gupta 09/27/2011 11:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.