我正在使用SQL Server 2008中的数据库表,它是Classic ASP应用程序的后端。我继承了这个数据库表,它保存了每个课程的“结果”。
每一行代表一个'目标',然后'结果'在列中 - 列值表明目标是否符合特定结果。
以下是当前db表的列的示例:
ID | Objective | Outcome1 | Outcome2 | ... Outcome11
最近,有人表示需要在每一行中添加一组新的描述符。简称“KSA”,它代表“知识,技能和态度”。基本上,KSA将每个结果的描述“爆炸”成细节。
在知识范围内,有一组特定于第一个结果的标识符。第二个结果有一组不同的标识符,依此类推。 “技能”和“态度”每个都有自己的标识符,这些标识符也会因结果而异。
为了帮助总结,每门课程的目标数量都是未知数量 - 通常为10-20。他们不为人知的原因是他们是由教师输入申请,数量取决于他们课程的特殊要求。
对于每个目标(行),已存在11个结果列。
新的KSA方面将包含:
...... a variable number of identifiers for "Knowledge" that relates to outcome 1.
and... a variable number of identifiers for "Knowledge" that relates to outcome 2.
and so on...thru outcome 11
and... a variable number of identifiers for "Skills" that relates to outcome 1...
and... a variable number of identifiers for "Skills" that relates to outcome 2...
and so on...thru outcome 11
and... the same for "Attitudes"
and so on...thru outcome 11
我继承了表格,其中为11个结果中的每一个提供了单独的列。 我们将保留这一方面,并通过添加KSA添加更多细节。但是,随着KSA的增加,我想知道添加数据结构的最佳方法。如果我要为每个KSA提供一个单独的列,我最终会得到大约140个新列,而且似乎应该有更好的方法来保存数据。此外,许多KSA列可能包含null。
另外,我曾考虑将所有KSA数据放在一列中,作为分隔字符串,但是当用户执行搜索时,似乎会出现性能问题,因为需要进行相当多的操作每次都要在字符串上执行。
以下是KSA中“大纲”形式的数据示例,该示例说明了如何使用KSA描述符将每个结果细分为更精细的细节:
Outcome: Calculations-The graduate will be able to perform calculations accurately.
Knowledge:
1. specific calculations
2. specific factors that influence calculations.
Skills:
1. employing consistently accurate mathematical ability in all calculations.
2. applying principles of calculations and specific factors to determine the appropriate use of therapy.
3. completing calculations needed to prepare specific results.
Attitudes:
1. stating the importance of accurate calculations.
2. recognizing the impact of calculation errors on response and risk
添加KSA元素的最佳方法是什么?我曾想过使用一个单独的表,因为每个结果的数据被分成多个描述符的方式,但不确定如何在逻辑上去做。
感谢您的帮助。
答案 0 :(得分:2)
我将Outcome列更改为外键,引用“Outcomes”表,其中引用记录的一个字段为您提供主表中当前具有的字符串描述,其他字段为KSA或对其他K,S和A表的引用取决于KSA元素是否对结果是唯一的。