Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

OLTP Design Question

 
   Database Help (Home) -> Programming RSS
Next:  Select more than just *  
Author Message
dbaprad

External


Since: Jan 17, 2008
Posts: 2



(Msg. 1) Posted: Mon Nov 16, 2009 9:26 pm
Post subject: OLTP Design Question
Archived from groups: microsoft>public>sqlserver>programming (more info?)

I have a design question regarding an OLTP system.

I have the following lookup tables and a mapping table between them.
I need to store Drugs associated to Program and Manufacturer.
Which would be a better option design wise,
1. Store ProgramManufacturerID in Drug table.
2. Store ProgramID and ManufacturerID in Drug table.

Please let me know...

Program_LKP
ProgramID INT IDENTITY(1,1) NOT NULL
ProgramName VARCHAR(255) NOT NULL
InactiveFlag CHAR(1) NOT NULL
CreatedByID INT NOT NULL
CreatedDate DATETIME NOT NULL
ModifiedByID INT NOT NULL

Manufacturer_LKP
ManufacturerID INT IDENTITY(1,1) NOT NULL
Manufacturer VARCHAR(255) NOT NULL
InactiveFlag CHAR(1) NOT NULL
CreatedByID INT NOT NULL
CreatedDate DATETIME NOT NULL
ModifiedByID INT NOT NULL
ModifiedDate DATETIME NOT NULL

Program_Manufacturer
ProgramManufacturerID INT IDENTITY(1,1) NOT NULL
ProgramID INT NOT NULL
PapManufacturerID INT NOT NULL

Option 1
Drug
DrugID BIGINT IDENTITY(1,1) NOT NULL
ProgramManufacturerID INT NOT NULL


Option 2
DrugID BIGINT IDENTITY(1,1) NOT NULL
ProgramID INT NOT NULL
ManufacturerID INT NOT NULL


Thanks in advance

 >> Stay informed about: OLTP Design Question 
Back to top
Login to vote
Philipp Post

External


Since: Nov 17, 2009
Posts: 1



(Msg. 2) Posted: Tue Nov 17, 2009 8:11 am
Post subject: Re: OLTP Design Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Which would be a better option design wise,
1. Store ProgramManufacturerID in Drug table.
2. Store ProgramID and ManufacturerID in Drug table. <

What about just putting the manufacturer_id into the drugs table. The
path to the "program" you will find in your Program_Manufacturer
table.

There are also some additional point to research on the primary keys.
Most likely you will find an industry standard for the drugs and the
manufacturers, which would be a better choice than IDENTITY. Also I
can not see a point for the ProgramManufacturerID in the
Program_Manufacturer table (the proper primary key is a compound one
of the both columns program_id and manufacturer_id).

brgds

Philipp Post

 >> Stay informed about: OLTP Design Question 
Back to top
Login to vote
--CELKO--

External


Since: Jan 11, 2008
Posts: 1089



(Msg. 3) Posted: Wed Nov 18, 2009 3:18 am
Post subject: Re: OLTP Design Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You might want to bother to do minimal research before you start to
code.

http://en.wikipedia.org/wiki/National_Drug_Code

Then learn what a key is and stop using those non-relational, magical
IDENTITY properties all over the place. Your design also has audit
metadata, flags, split attributes and improper data element names. I
cannot see anything you have done right.

The fact that you do know either RDBMS or this industry days that this
is a home work assignment. We do not do homework here.
 >> Stay informed about: OLTP Design Question 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
A Design Question - Hi I have 2 tables which both refer back to each other by forign keys. Table A A_ID int FK_B_ID int Table B B_ID int FK_A_ID int Now when I want to delete a record from either table I have to null out the ID in the other table first. Is this a SQL..

database design question - I am attempting to develop a forum. I have the pages I need and was just curious if anyone here knows, or if there is a website, how to setup a database for a forum? Basically, the columns is what I need.

DB Design Question. - Hi Everyone: I am trying to come up with a good db design for time tracking an employee's time on one of the client projects that I am working on. The background is as follows: 1). An Employee can work on administrative tasks and also some special ..

database design question - i have this table that i'm designing create table person (id int identity(1,1) primary key, name varchar(50) not null, skill_id int not null) create table skill (skill_id int identity(1,1) primary key, skill_name varchar(30)) i'd like to make..

Database Design Question... - Hi all, First of all, I hope this question fits this newsgroup. Currently I'm developing a resource management application, and I need to implement some scheduling functionality for the employees (and other resources), and I'm facing some problems..
   Database Help (Home) -> Programming All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]