If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Normalization with internal dependancy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-26-11, 03:02
Agentsmith07 Agentsmith07 is offline
Registered User
 
Join Date: Sep 2011
Posts: 1
Normalization with internal dependancy

Hi,

I have a table storing score and level information of a user. Both are integers. Level value depends on score and mapping is not expressable as a mathematical function. There are min, max values of points for every level.

Please help me to design the dabase table. My problem is, if use level as a column in user table, it doesnt normalize as 2NF as level changes as per score and not as per primary key only (which is say - username). Please suggest me some alternative so that i can define properly normalized tables.

I am new to this forum, so plee forgive me if this is too obvisous or repeated question.
Reply With Quote
  #2 (permalink)  
Old 09-26-11, 12:47
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
There is no problem with storing two different values that are casually related in the same row of a table as long as both values are directly related to that row's primary key. Keeping the point score and the level for a given user makes perfect sense to me.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #3 (permalink)  
Old 09-26-11, 14:37
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
"casually" being the operative word
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On