I'm creating a database for housing component manufacturing plant. I have relations of Orders can have one to three Sub-Orders which can have one or many Levels(floors) which can have one or many Parts(trusses or panels) each Part belongs to one Shipment(has one or many Parts) many shipments make up a delivery Run.
I have read http://www.thescripts.com/forum/thre...elational.html and do have a similar situation but was looking for advice for this situation. Also just voicing my problem may help myself.
What I have done is after the Sub-Order table and depending on the Sub Order (Roof Truss or Wall Panel, Floor Truss) I have a seperate table for Roof Levels, Wall Panel Levels and Floor Truss Levels with each having seperate Parts table. The reason for this is the information that they contain is different between the parts. Also, I have to track more production information with panels then I have to with trusses as we have a seperate program for trusses. I have not created the shipment tables as this is where the difference between the sub orders end. A shipment may contain panels or trusses but not both. A Run may contain a shipment of panels and a shipment of trusses. Also another consideration is that a shipment may contain loose lumber which is not related to any panel or truss but related to the level they belong too.
Have I gone too deep with my model? Should I combine the Levels tables and Parts Tables? If I keep this structure how do I create the shipment table to reflect what they contain from different tables?
Thanks for the help
5 1729
Firstly, its not clear whether you read the article referred to in the other thread Normalization and Table Structures. I would recommend you do that first.
Secondly if you need us to look at the structure of your database you have to provide that structure in the form of metadata.
Here is an example of how to post table MetaData :
[b]Table Name=tblStudent[/] -
Field; Type; IndexInfo
-
StudentID; AutoNumber; PK
-
Family; String; FK
-
Name; String
-
University; String; FK
-
Mark; Numeric
-
LastAttendance; Date/Time
Thanks for the reply Mary,
I have read the normalization article. (read it again too). Can you take this statement too far?
Create a separate table for each set of related data and Identify each set of related data with a primary key
I've created a table for each SubOrder type and each of those tables have a suborder parts table (Panels,Trusses). See Below
Here is my table structure:
Table: Orders - JobOrderID, Auto#, PK
-
Model, Number, FK
-
Lot, Text,
-
Subdivision, Number, FK
-
RecievedDate, Date
-
CustomerID,Number, FK
Table: SubOrders - SubOrderID, Auto#, PK
-
JobOrderID, Number, FK
-
SubOrderType, Number, FK
Table: Floors (Wall Panel) - FloorID, Auto#, PK
-
SubOrderID, Number, FK
-
Floor, Text,
Table: Panels - PanelID, Auto#, PK
-
FloorID, Number, FK
-
PNLLabel, Text,
-
PNLNum, Number
-
Type, Text
-
Class, Text
-
Size, Number
-
Length, Number
-
Height, Number
-
Complete, Yes/No
-
CompleteDate, Date/Time
-
Bunk, Text
Table: Roofs - RoofID, Auto#, PK
-
SubOrderID, Number, FK
-
FloorType, Number, FK
-
MBARefNum, Number, FK to External Database
-
MBAJobName, Text
Table: RoofTrusses - RoofTrussID, Auto#, PK
-
RoofID, Number, FK
-
RTrussName, Text
-
RTrussType, Text
-
RTrussQty, Number
-
RTrussSpan, Number
-
RTrussPrice, Currency
Table: TrussFloor - TrussFloorID, Auto#, PK
-
SubOrderID, Number, FK
-
FloorType, Number, FK
-
MBARefNum, Number, FK to External Database
-
MBAJobName, Text
Table: FloorTrusses - FloorTrussID, Auto#, PK
-
FloorTrussID, Number, FK
-
FTrussName, Text
-
FTrussType, Text
-
FTrussQty, Number
-
FTrussSpan, Number
-
FTrussPrice, Currency
There are many similarites between Roof & Floor Trusses should these tables be combined? Is spliting them up making the tables too specific?
Handling Shipments: A shipment has one or many Panels/RTrusses/FTrusses. Should I have a table for each shipment type:
(ie Table: WPanelShipments - WPanelShipID, Auto#, PK
-
WPShipDueDate, Date/Time
) Panels table would have a WPanelShipID FK
This would be also true for the rooftrusses and floortrusses tables
Runs: A Run has one or many Shipments of any of the types. My inital thought here is to have a Run table and a RunDetails table with this stucture...
Table: Run - RunID, Auto#, PK
-
RunDate, DateTime
-
RunDriverID, Number, FK
Table: RunDetail - RunID, Number, PK
-
WPanelShipID, Number, PK
-
RTrussShipID, Number, PK
-
FTrussShipID, Number, PK
The RunDetail table correct? This would be my biggest mental hangup.
Thanks for your time
I understand why you have broken them out but I'll need some time to look at the structure of this. Leave it with me and I'll get back to you as soon as I can.
I understand why you have broken them out but I'll need some time to look at the structure of this. Leave it with me and I'll get back to you as soon as I can.
Any Luck or Applied Skill?
Thanks
For posterity
I am still unable to solve the relations above, so I decided to change the structure as follows:
Orders - remains the same
SubOrders - remains the same
Floors, Roofs, TrussFloors combined into 'Assemblies'
Panels, RoofTrusses, FloorTrusses combined into 'Items'
Relations:
Orders have 1:M SubOrders which have 1:M Assemblies which have 1:M Items
Runs have 1:M Shipments which have 1:M Items
I am planing to break out the item descriptions into seperate tables (Panels, Trusses etc), have not gotten that far yet.
Here is my table structure:
Table: Orders - JobOrderID, Auto#, PK
-
Model, Number, FK
-
Lot, Text,
-
Subdivision, Number, FK
-
RecievedDate, Date
-
CustomerID,Number, FK
Table: SubOrders - SubOrderID, Auto#, PK
-
JobOrderID, Number, FK
-
SubOrderType, Number, FK
Table: Floors (Wall Panel) - FloorID, Auto#, PK
-
SubOrderID, Number, FK
-
Floor, Text,
Table: Panels - PanelID, Auto#, PK
-
FloorID, Number, FK
-
PNLLabel, Text,
-
PNLNum, Number
-
Type, Text
-
Class, Text
-
Size, Number
-
Length, Number
-
Height, Number
-
Complete, Yes/No
-
CompleteDate, Date/Time
-
Bunk, Text
Table: Roofs - RoofID, Auto#, PK
-
SubOrderID, Number, FK
-
FloorType, Number, FK
-
MBARefNum, Number, FK to External Database
-
MBAJobName, Text
Table: RoofTrusses - RoofTrussID, Auto#, PK
-
RoofID, Number, FK
-
RTrussName, Text
-
RTrussType, Text
-
RTrussQty, Number
-
RTrussSpan, Number
-
RTrussPrice, Currency
Table: TrussFloor - TrussFloorID, Auto#, PK
-
SubOrderID, Number, FK
-
FloorType, Number, FK
-
MBARefNum, Number, FK to External Database
-
MBAJobName, Text
Table: FloorTrusses - FloorTrussID, Auto#, PK
-
FloorTrussID, Number, FK
-
FTrussName, Text
-
FTrussType, Text
-
FTrussQty, Number
-
FTrussSpan, Number
-
FTrussPrice, Currency
There are many similarites between Roof & Floor Trusses should these tables be combined? Is spliting them up making the tables too specific?
Handling Shipments: A shipment has one or many Panels/RTrusses/FTrusses. Should I have a table for each shipment type:
(ie Table: WPanelShipments - WPanelShipID, Auto#, PK
-
WPShipDueDate, Date/Time
) Panels table would have a WPanelShipID FK
This would be also true for the rooftrusses and floortrusses tables
Runs: A Run has one or many Shipments of any of the types. My inital thought here is to have a Run table and a RunDetails table with this stucture...
Table: Run - RunID, Auto#, PK
-
RunDate, DateTime
-
RunDriverID, Number, FK
Table: RunDetail - RunID, Number, PK
-
WPanelShipID, Number, PK
-
RTrussShipID, Number, PK
-
FTrussShipID, Number, PK
The RunDetail table correct? This would be my biggest mental hangup.
Thanks for your time
Sign in to post your reply or Sign up for a free account.
Similar topics
by: comcast |
last post by:
Hello all,
I am developing an interface system for an application I was written. This
interface will connect to other system to share information. I would like
to use
xml and xsl to generically...
|
by: Olivier Jullian |
last post by:
Hi,
I'm new to .NET and am trying to take advantage of the
object structure while accessing relational databases.
I started a small project for managing "projects". Here is
a description of...
|
by: Mike MacSween |
last post by:
I frequently hear that there isn't a commercially available dbms that fully
implements the relational model. Why not? And which product comes closest.
Mike MacSween
|
by: cassandra.flowers |
last post by:
I'm designing a database because I have to do it for the preperation work
for my A-Level ICT exam.
The database is for a building company. It has to store information on
building projects...
|
by: Tim Fierro |
last post by:
Hello,
I have had many years using flat file databases (File Express from way back)
but am now at a company where a relational database is needed and would
carry us into the future. Since I...
|
by: Robert Abi Saab |
last post by:
Hi everyone. I just finished a course on PostgreSQL and I found out that
PostgreSQL doesn't provide any object relational features (as claimed in
the official documentation), except table...
|
by: shahram.shirazi |
last post by:
Hi all,
This is a very stupid question, but it has been years since i've
touched databases so any help will be very appreciated.
I am designing a school registration database which also serves...
|
by: Pradeep |
last post by:
Hello,
I need to take a set of input tables and create an XML output file. The
format of the XML output must be user-definable and must be intuitive
enough for non-techies to use.
input...
|
by: sulyokpeti |
last post by:
I have made a simple python module to handle SQL databases:
https://fedorahosted.org/pySQLFace/wiki
Its goal to separate relational database stuff (SQL) from algorythmic
code (python). A SQLFace...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
| |