473,503 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Before I Go Too Far

blyxx86
256 Contributor
I've contemplated doing this for a while, but as I was writing the CREATE TABLE syntax I became a little weary about it.

Essentially I am creating one table for both INBOUND and OUTBOUND products, with a ENUM('IN','OUT') separating the two. I was going to create two views vinbound and voutbound.

My question is... Does this violate any database principles? I am trying to stay within BCNF and having multiple TrackingNumber fields (one in an Outbound and one in an Inbound) seems to violate BCNF?

I'd like your 2 cents before I hit execute on my script.

Thanks!
Kyle
Dec 2 '08 #1
4 1539
code green
1,726 Recognized Expert Top Contributor
Instinct is screaming that the table should be split into two.
This is the way it would be done in big set-ups.
I have never seen sales and purchases mixed.
Say in the future you wished to compare inbound products to outbound products.
Quite a simple query with two tables but with one you would JOIN a table to itself giving each an alias and yourself a headache.
This of course is only my opinion from personal experience.
Dec 5 '08 #2
blyxx86
256 Contributor
That's how I used to look at it too, but I remember someone suggesting that (logically) they are related to each other and should therefore be placed in the same table.

However, I have been arguing this in my head for a while about whether they are actually separate things, or if they are in fact related to each other enough to have in the same table.

Essentially.. The tables would be identical, and it would seem like the concepts of database normalization are being broken. BUT!!!! Are they really being broken? One is showing SHIPMENTS, the other RECEIPTS. The views I was creating broke the table into two separate entities which I would be using through the application instead of directly back to the table.

My instincts are the same as yours, but there is something about having two (well with the child entities four) duplicate tables that just doesn't feel right either.
Dec 5 '08 #3
code green
1,726 Recognized Expert Top Contributor
I can see you point. Both tables would have the same or similar field headings
Product, Date, etc.
But a 'sale' generates an invoice, a 'buy' a purchase order.
Similar but different
My sales tables have an order_date, packed_date, shipped_date.
But purchase tables have order_date, date_promised and date_received.
Similar but different

Sometimes with normalisation it is sometimes better to settle for a happy medium.
For example, more tables mean more joins but leaner tables.

I prefer to build flexibility into a design and allow for future changes
but rarely take normalisation to its limit.
Dec 5 '08 #4
blyxx86
256 Contributor
I'm currently taking a database processing class and normalization was about 6 chapters worth. It was pretty intense, and it got engraved in my mind.

I built a database a while ago that had the two table version. It works just fine, it was just the discussion I had with someone that made me think the tables are related because they have the same root 'noun' of "movement."

I am opting to go for the two table version. It just makes more sense. One could argue that it breaks normalization rules, but it could also be argued that it doesn't. I'm riding the fence right now between the two. I really just don't know.

I appreciate the second opinion on this. I needed the little push to get me off the fence and on to a side.
Dec 5 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4601
by: Manuel | last post by:
Can I invoke a function before main I could do it by invoking it in a Global object's constructor . Is there any other method other than this. Manuel
1
5654
by: jasonshohet | last post by:
I read recently that: "if a before-image was made before an interruption in database processing, you use the before-image dump & simply begin processing again from just before the last...
2
6424
by: 73blazer | last post by:
Perhaps my thinking is wrong but this is what I have: 1 table (Tab1) with 1 attribute (Attr1) Attr1 char(16) for bit data ----------------------------------------------- create trigger...
7
2560
by: Weaver | last post by:
I need to check the status of some records (detail records in a master detail form) _before_ moving off the current master record. Anyone know what event will catch this?
5
4459
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a...
3
16190
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
4
3247
by: Jean-François Michaud | last post by:
Hello, I've been looking at this for a bit now and I don't see what's wrong with the code. Can anybody see a problem with this? Here is an XSLT snippet I use. <xsl:template match="graphic">...
2
1458
by: Curious | last post by:
I have a method that uses a lot of delegates. Since there seems to be a severe delay on UI (it takes a while before the tab displays the file name), I'll need to add debugging info, specifically...
10
15731
by: preeya | last post by:
Hi, I have written the following program: ------------------------------------------------------------------------------------------------------------- 1 #include <stdio.h> 2 #include...
21
479
by: coolguyaroundyou | last post by:
See the below code: void func(int x) { printf("%d",x); } int main() { int j=0;
0
7205
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
7287
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,...
1
7006
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...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.