School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,424 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,518 people online right now. Registration is fast and FREE... Join Now!




Need some help designing data scheme

 

Need some help designing data scheme, For Import/Export company

CrazedAzn

25 Jun, 2009 - 11:22 AM
Post #1

New D.I.C Head
*

Joined: 26 Sep, 2007
Posts: 20


My Contributions
Hey DIC,

I'm working on designing the back-end and front-end of a freight forwarding company.

So, my situation is:

The company has multiple branches (NY, SEA, SFO, etc.). Each branch fills out something called an AirWaybill which contains details on the shipment. Each AirWaybill has a Master Airwaybill number which will be its Primary Key since it is unique. However, each AirWaybill also has an internal reference number that is unique to each branch but NOT unique to the whole company.

For example, you can have a reference number E0906241 that can exist in both the NYE branch and the SEA branch. How can I store this in a database effectively?

My current thought is to append the branch to the front of the reference number. (i.e. SEA-E0906241 and NYE-E0906241). Problem is, there would be a lot of redundancy (NYE-*, SEA-*, etc.). Is this the best way to do this?

Thanks for taking the time to read.

User is offlineProfile CardPM
+Quote Post


kzimmerm

RE: Need Some Help Designing Data Scheme

25 Jun, 2009 - 11:28 AM
Post #2

D.I.C Head
**

Joined: 8 Feb, 2009
Posts: 67



Thanked: 3 times
My Contributions
QUOTE(CrazedAzn @ 25 Jun, 2009 - 11:22 AM) *

Hey DIC,

I'm working on designing the back-end and front-end of a freight forwarding company.

So, my situation is:

The company has multiple branches (NY, SEA, SFO, etc.). Each branch fills out something called an AirWaybill which contains details on the shipment. Each AirWaybill has a Master Airwaybill number which will be its Primary Key since it is unique. However, each AirWaybill also has an internal reference number that is unique to each branch but NOT unique to the whole company.

For example, you can have a reference number E0906241 that can exist in both the NYE branch and the SEA branch. How can I store this in a database effectively?

My current thought is to append the branch to the front of the reference number. (i.e. SEA-E0906241 and NYE-E0906241). Problem is, there would be a lot of redundancy (NYE-*, SEA-*, etc.). Is this the best way to do this?

Thanks for taking the time to read.


Why not set the Branch id & reference # as the primary key in the file?

Kurt


User is offlineProfile CardPM
+Quote Post

CrazedAzn

RE: Need Some Help Designing Data Scheme

25 Jun, 2009 - 11:31 AM
Post #3

New D.I.C Head
*

Joined: 26 Sep, 2007
Posts: 20


My Contributions
Oh shoot, so I can do this:

Table: NYE_Data ( PK:'Ref#', FK:'AWB#')
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 12:18AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month