To normalize or not  
Author Message
Grigory





PostPosted: Thu Aug 21 07:48:42 CDT 2003 Top

SQL Server Developer >> To normalize or not

I have a database that has repeated measures. PatientID, BPat5mins,
BPat10mins, BPat15mins,...............BPat30mins.

I am telling my co-worker that instead the table design should be
PatientID, BP, TimeInterval

My co-worker is telling me that the first way allows for easier grouping and
aggregates. What do you guys think.

Thanks,
John

SQL Server119  
 
 
Jens





PostPosted: Thu Aug 21 07:48:42 CDT 2003 Top

SQL Server Developer >> To normalize or not Hello TopDog (Wonder if this is your realname and EMailAdress :)) )

Normalization should be always aimed. The first solution of your colleage is
NOT really good. Perhaps you save time by not joing another table with
times, but...

You will be always stuck with minutes, you can´t change the time column to
another interval without writing it down in characters, when you sum them,
you have to chop the minutes and then sum the values. Not recommendable!

Jens Süßmeyer.



 
 
Narayana





PostPosted: Thu Aug 21 07:34:10 CDT 2003 Top

SQL Server Developer >> To normalize or not I would go with the second approach. I don't want to add a new column to my
table, when we decide to measure BP at a new interval.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm




I have a database that has repeated measures. PatientID, BPat5mins,
BPat10mins, BPat15mins,...............BPat30mins.

I am telling my co-worker that instead the table design should be
PatientID, BP, TimeInterval

My co-worker is telling me that the first way allows for easier grouping and
aggregates. What do you guys think.

Thanks,
John



 
 
Jens





PostPosted: Thu Aug 21 09:20:37 CDT 2003 Top

SQL Server Developer >> To normalize or not Mhhhm..

How deep normalisation goes depends on you. I would use a second table to
be able to change the name of the time interval as i wanted.

When is would query the database i would use a dynamic sql or a function to
calculate the times to a common format.

That the say dbs goes :))


HTH, Jens Süßmeyer.


 
 
topdog





PostPosted: Thu Aug 21 10:48:30 CDT 2003 Top

SQL Server Developer >> To normalize or not Anyone else have some strong opinions on this? It doesn't seem that it
really matters either way from what I"m getting so far.

Thanks




> I have a database that has repeated measures. PatientID, BPat5mins,
> BPat10mins, BPat15mins,...............BPat30mins.
>
> I am telling my co-worker that instead the table design should be
> PatientID, BP, TimeInterval
>
> My co-worker is telling me that the first way allows for easier grouping
and
> aggregates. What do you guys think.
>
> Thanks,
> John
>
>


 
 
Anith





PostPosted: Thu Aug 21 11:13:58 CDT 2003 Top

SQL Server Developer >> To normalize or not >> Anyone else have some strong opinions on this? It doesn't seem that it
really matters either way from what I"m getting so far. <<

This is not a matter of strong opinions since generic suggestions are not
always applicable to your specific logical design.

Ask yourself some basic questions. What is the flaw with your co-worker's
approach? What will you do when you have an additional time interval, alter
the table? What is an actual attribute to your patient entity, BPat5mins or
BP? Can TimeInterval be a valid attribute? Remember, in relational model, a
table represents a valid entity type, a row represents a valid entity of
that type and the columns represent valid attributes of that entity.

The correct way to approach this is to first understand and analyze all your
business rules and relevant data requirements. Get someone (if you are not)
with fundamental understanding on the normalization rules to analyze your
model. A simple walkthrough can reveal if this violates 1NF or not.

--
- Anith
( Please reply to newsgroups only )


 
 
Dan





PostPosted: Thu Aug 21 11:38:22 CDT 2003 Top

SQL Server Developer >> To normalize or not To add my .02, the normalized approach is definitely the most flexible.
Personally, I would go with that unless you have a good reason to do
otherwise. If you don't have the SQL expertise to group and aggregate
the normalized data, one can argue that is justification for
denormalization.

It's common to deploy specialized reporting databases to simplify
reporting and improve performance. However, the operational database
schema is often left normalized.

--
Hope this helps.

Dan Guzman
SQL Server MVP

-----------------------
SQL FAQ links (courtesy Neil Pike):

http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------



> Anyone else have some strong opinions on this? It doesn't seem that
it
> really matters either way from what I"m getting so far.
>
> Thanks
>
>


> > I have a database that has repeated measures. PatientID,
BPat5mins,
> > BPat10mins, BPat15mins,...............BPat30mins.
> >
> > I am telling my co-worker that instead the table design should be
> > PatientID, BP, TimeInterval
> >
> > My co-worker is telling me that the first way allows for easier
grouping
> and
> > aggregates. What do you guys think.
> >
> > Thanks,
> > John
> >
> >
>
>


 
 
Mike





PostPosted: Mon Aug 25 09:38:52 CDT 2003 Top

SQL Server Developer >> To normalize or not On Thu, 21 Aug 2003 11:38:22 -0500, "Dan Guzman"


>To add my .02, the normalized approach is definitely the most flexible.

It's often the simplest, too, when you have anything beyond the most
trivial integrity constraints.

--
Mike Sherrill
Information Management Systems