6 replies
by grhbiz Accepted solution
by robo_dev Accepted solution
So 'coil' is some sort of thing like a coil of wire, 'pipe' is a sample of pipe, and 'heat' is a heater of some sort??
And the lab test results are your data for each item?
In general, I would create a table for coil, a table for pipe, and a table for heat. I would assign a unique value for each test, and use that as the key for each table.
Alternately, a table of test results, with the columns being coil/pipe/heat, and the record being the test number (assuming you test all three at the same time).
You then would create a view which would be a stored query to get the data back out.
by grhbiz Accepted solution
by robo_dev Accepted solution
thinking out loud:
forgive me if this sounds too preachy, but at a high level, the first thing we need to do is establish the tables, decide what will be their primary keys, and make sure the whole relationship makes sense, correct?
The first issue is to address the one-to-many relationship between coils and pipes. Effectively the 'Coil table' would be the master table of the database, since there is a one-to-many relationship bewtween coils and pipes, the coil table is the only way to keep track of that.
I would start with some sort of a Coil table which allows you to track what pipes belong to what coil. The key would be the coil alpha code. Attributes of the table would be the heat numbers, the pipe numbers.
Then a pipes table, to track what heat numbers (tests) were done to what pipe.
Finally a 'heat table' with attributes such as type (pipe or coil) heat number, date, customer, test result, etc.
It does not matter is the lab test records are different, as long as there is a place to enter the data for each test. Unless it is totally impossible, it would be much simpler to have a 'one size fits all' test result table.
Thinking more out loud, it would be helpful if your numbering system were such that pipe numbers are subsets of coil numbers. So that the pipes produced from coil 1234 would be numbered as 1234-1 1234-2, etc. This would make queries and sorting much easier....
Not sure if this is at all helpful or not....
by grhbiz Accepted solution
Yes it does sound like a sump the db expert exam question! Thanks for the table structure suggestion, I am going to try it.
Although, our pipe/coil/heat numbering system is already in use and also being used in a manufacturing pipe tracking software....I have to use what is already in place. If I make the coil number the pk in the first table....what would the pk be in the pipe table and the heat table? I am also going to try and make the lab tests one table (I can always put the individual lab tests in separate forms). In the lab test table what would you suggest as the primary key?
by robo_dev Accepted solution
so the only thing that would work, I think, would be the pipe tracking number.
Also the heat number would have to be the primary key for that table.
The primary key would be the link between the tables.
http://databases.about.com/cs/administration/g/primarykey.htm
I would see if you can export or link data from your pipe tracking software if you can...if it uses a standard database, that would save you tons of time and also ensure data integrity.
This discussion is closed to new replies.
Trending Software posts
Sort by Trending