SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to normalize it
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Abid
Posting Yak Master

Pakistan
102 Posts

Posted - 04/20/2013 :  11:19:31  Show Profile  Reply with Quote
Hi. I have some 15 attributes which i need to put in single table, but if i do this so redundency, and partial and transitive dependencies are rising. The situation is as under:

PatientInfo
PatientID, Name, FatherName, Age, Sex, Address, ContactID

UserInfo
UserID, Name, DutyShift, Cadre, Status, Login Time, Entries

How do i normalize it? What i need is to simply save the record, that which user, in which shift, how many patients he dealt, on daily date? Please guide me.

James K
Flowing Fount of Yak Knowledge

3334 Posts

Posted - 04/20/2013 :  12:51:23  Show Profile  Reply with Quote
quote:
Originally posted by Abid

Hi. I have some 15 attributes which i need to put in single table, but if i do this so redundency, and partial and transitive dependencies are rising. The situation is as under:

PatientInfo
PatientID, Name, FatherName, Age, Sex, Address, ContactID

UserInfo
UserID, Name, DutyShift, Cadre, Status, Login Time, Entries

How do i normalize it? What i need is to simply save the record, that which user, in which shift, how many patients he dealt, on daily date? Please guide me.

If your requirement indeed is that you need to put all of it into a SINGLE table, I don't know of a way to normalize it. When you normalize, you necessarily end up with more than one table.

That said, I think what you need to do is to have a series of tables:
1. Patients - pretty much like what you have.
2. Users - I assume this is employees at the facility.
3. Shifts - This would indicate when a shift starts, when it ends etc.
4. UserShifts - This would relate Users who are working a given shift
5. UserPatients - This would have an entry each time a user deals with a patient.

I want to make the disclaimer that I don't know anything about your business requirements, so this is just an educated guess.
Go to Top of Page

Abid
Posting Yak Master

Pakistan
102 Posts

Posted - 04/20/2013 :  22:00:26  Show Profile  Reply with Quote
Ok. Lets say if i don't use single table and use the same 2 tables as i have, so what will be your opinion then?

Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3334 Posts

Posted - 04/21/2013 :  07:34:29  Show Profile  Reply with Quote
If you can use only two tables, what you have there is pretty much what you need. Each time a user completes a duty shift, you would enter one row with his/her name, how many patients he cared for, and any other information required. etc. That would of course mean that you would be repeating the information such as Cadre, Status etc. in every row.

Is there any reason you cannot add normalized tables? The cost of adding a new table is so little (some metadata) and the benefits in terms of storage, ease of querying, maintenance etc can be significant.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000