Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
pablrodr
Starting Member
3 Posts |
Posted - 2010-08-10 : 11:29:55
|
| Good afternoon,I'm trying to calculate the difficulty level of some exercises, each exercise is identified by a numeric id and the difficulty level is defined by its parameters, each exercise has a different number of parameters.To calculate the difficulty level for each exercise we identify all the possible values that each parameter can take, those values are given to us in a specific (and correct) order in a table, and we assign a numeric value starting from 1 to each one of it, for example if the values of parameter p are p1,p2 and p3 we have to assign a number starting from 1 to each of them:p1=1p2=2p3=3Once assigned this values to each parameter, the difficulty level of the exercise is the sum of the values of every parameter.Given an execution of the i exercise in a table:Id Parameters Valuesi p p2i q q3i r r1the three lines above should be replaced by one lineId Difficultyleveli 2+3+1Any help please |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-10 : 13:12:33
|
| where do you set the values for p2,q3 etc as 2,3,etc?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
pablrodr
Starting Member
3 Posts |
Posted - 2010-08-10 : 14:52:48
|
| I don't know where to set those values, but there's a fixed number of exercises ( 100 more or less) and for each exercise I've got the parameters and the values that those parameters take are ordered according to their difficulty, because the designers of the exercises gave those data to me, part of the problem is how to store those values, for the moment I have one table with 4 columns: Id, Parameter, Value and AssignedValue where Id is the identification of the exercise, Parameter are the parameters, Value are for each parameter its (ordered) possible values. For example:Id Parameter Value AssignedValue1 p1 100 11 p1 200 21 p1 300 3where Id (p1,100) is easier than Id(p1,200) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-10 : 15:08:31
|
| then isnt it matter of summing difficulty levels after grouping by Id?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
pablrodr
Starting Member
3 Posts |
Posted - 2010-08-11 : 04:03:21
|
| I can't see how because now I have a table of exercises executions:Id Parameters Valuesi par1 300i par2 4i par3 8j par8 200j par8 7meaning that exercise i was executed using parameters par1, par2 and par3. par1 was executed with a value of 300par2 was executed with a value of 4and par3 with a value of 8 I have another table for the assignement of values to that parameters:Id Parameter Value AssignedValuei par1 50 1i par1 75 2i par1 300 3i par1 350 4i par2 2 1i par2 3 2.....This means that for exercise i parameter par1 can take the values 50,75,300 or 350 and that for 50 it is assigned a 1 value of difficulty, for 75 it is assigned a 2 value of difficulty, 300 is assigned a 3 value of difficulty and 350 is assigned a 4 value of difficulty.. and so on for par2.For calculating the difficulty of an exercise I need to sum all the difficulty values of all the parameters of that exercise.. |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2010-08-11 : 10:07:26
|
| Help us help you: Follow the link, then give us the information we need.http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxhttp://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
|
|
|
|
|