在sql中更多表或更多行更好? [英] more table or more rows better in sql?

查看:67
本文介绍了在sql中更多表或更多行更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实我正在为学术机构建立一个软件,所以我只想知道几个问题的答案:



1)如你所知,一些新数据将每年生成(新招生),有些将升级。所以我应该将所有数据存储在一个单独的表中,并与学年分离(如ac_year这样的列),或者我应该为每年制作单独的表。还有不同的表来存储关于学生的信息,如课程,标记,费用,宿舍等。因此,每个信息,如费用将存储在不同的表格中,如

费用-2010

费用-2011

费用-2012 ...



或单一费用表,以年为一列。



还有一点是,在1 - 2年后不久,数据库将变得更重,因此可以在单个表中备份一年的数据(如同年费用一样)作为专栏)?





请记住SQL Server 2005。



谢谢

Actually i am building a software for academic institutions, so i just wanted to know answers of a few questions:

1) As you know the some new data will be generated each year(for new admissions) and some will be upgraded. So i should store all the data in one single table with academic year separation(as a column like ac_year) , or should i make separate tables for each year. Also that there are to be different tables to store information like, classes, marks, fee, hostel, etc about the students. So each Info, like Fee would be store in different tables like
Fee-2010
Fee-2011
Fee-2012...

Or in 1 single Fee table with year as a columns.

One more point is that soon after 1-2 years database will get heavier so backing up data for a single year would be possible in single table(Like Fee with year as a column) ?

And
Please answer keeping in mind SQL Server 2005.

Thanks

推荐答案

快速而不是很好的答案是:一点点,还有一点点。

这两种方法都是有效的解决方案。我个人不喜欢建立一个需要每年进行结构更新的应用程序的想法,所以我倾向于一个两个表系统,你有一个实时数据表,其中存储当前数据和一个存档使用自动SSIS流程将所有过时数据移动到的表。
The quick and not great answer is: A little of this, and a little of that.
Both methods are valid solutions. I personally don''t like the idea of having an application built that will require structural updates for each year, so I would lean towards a two table system where you have one "live" data table where current data is stored and a single "archive" table where all out-of-date data gets moved to using an automated SSIS process.


这篇关于在sql中更多表或更多行更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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