I produced a listing system which mostly is applying a server-on the sides scripting language to complete everything. To acquire some performance gains I'm searching to higher design my database to reducing the scripts.

I've got a table named metal_part with a face to face relationship with five other tables, essentially another tables are also parts, which individuals parts then possess a face to face relationship having a couple of other tables.

After I query metal_part I want all of the UPC amounts from each table, so its direct face to face associations want to get their very own information using their direct face to face relationship tables ect... Can you really create a huge query to construct everything and set it inside a form at like:

(###) - ####/##/##/## [a-z]

Utilizing a query? or must i get all the details and concat it utilizing a scripting language?

Thanks

You need to have the ability to get all the important information utilizing a standard join, after which, using the concat function appropriate for your database (see here http://www.1keydata.com/sql/sql-concatenate.html) you are able to make up the string you would like.

Your real question is very vague.

I am speculating you're speaking about matching on the primary key known as partnumber or something like that like this.

This can be done utilizing a query like

SELECT mp.partnumber
  , mp.UPC_number
  , wp.UPC_number
  , pp.UPC_number
FROM metal_parts mp
INNER JOIN wood_parts wp ON (wp.partnumber = mp.partnumber)
INNER JOIN plastic_parts pp ON (pp.partnumber = mp.partnumber)
WHERE mp.partnumber = '8874578127';

You may also do

SELECT mp.partnumber
  , group_concat(mp.UPC_number) as metal_UPCs
  , group_concat(wp.UPC_number) as wood_UPCs
  , group(concat(pp.UPC_number) as plastic_UPCs
FROM metal_parts mp
INNER JOIN wood_parts wp ON (wp.partnumber = mp.partnumber)
INNER JOIN plastic_parts pp ON (pp.partnumber = mp.partnumber)
WHERE mp.partnumber = '8874578127'
GROUP BY mp.partnumber;

or

SELECT mp.partnumber
  , concat_ws(','
    , group_concat(mp.UPC_number)
    , group_concat(wp.UPC_number)
    , group(concat(pp.UPC_number)
  ) as UPCs_of_parts
FROM metal_parts mp
INNER JOIN wood_parts wp ON (wp.partnumber = mp.partnumber)
INNER JOIN plastic_parts pp ON (pp.partnumber = mp.partnumber)
WHERE mp.partnumber = '8874578127'
GROUP BY mp.partnumber;