如果存在于sql server,vb.net / asp.net中 [英] If exists in sql server,vb.net/asp.net

查看:69
本文介绍了如果存在于sql server,vb.net / asp.net中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在sql server中有一个表可以保存学生的历史记录。例如

I have got a table in sql server that will be keeping student history. For example

Studentid             grade          year
1                      2              2008
1                      3              2009
1                      4              2010
1                      4              2011
2                      4              2010
2                      5              2011



我怎样才能避免重复一年特别是学生?学生可以重复一个年级,但不能在同一年级。我怎样才能避免一个现在可以说是五年级的学生,因为明年他不能进入四年级。该应用程序位于vb.net/asp.net。任何帮助都会非常感激


how can i avoid to repeat a year for a particular studentid? A student can repeat a grade but not in the same year. And how can i avoid a student who is in lets say grade 5 now not to be entered as he is in grade 4 next year. The application is in vb.net/asp.net. Any help would highly appreciated

推荐答案

如果我正确理解您的架构,那么这些信息实际上是多余的,这是不可接受的。但是,这是一个分析问题,在这方面,您对应用领域的描述似乎并不完整,无法设计正确合理的架构。



你我可以在我过去的答案中找到一些有用的想法,专门讨论关联学生与群体的问题。你的学校模式可能与此类似。请参阅:学校数据库架构(级别问题) [ ^ ]。



-SA
If I understand your schema correctly, the information is really redundant, which is unacceptable. However, this is a matter of analysis, and your description of the application field does not seem to be complete to design a correct and reasonable schema in this respect.

You can find some useful ideas in my past answer devoted to the problem of association students with groups. Your model of the school might be similar to that. Please see: A School Database Schema (Level Problems)[^].

—SA


这篇关于如果存在于sql server,vb.net / asp.net中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆