有关使用表格或过滤器的问题 [英] Question about using tables or filters

查看:82
本文介绍了有关使用表格或过滤器的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我想问那些在制作数据库方面有相当经验的人。我正在考虑使用树视图控件来帮助通过连接字符串或使用过滤器将数据分成表。



我提供的数据是多州和县的信息。我正在考虑使数据库成为状态,然后让每个县成为该州的一个表,基本上我将拥有50个数据库。



我还可以做50个数据库和1个大表,并在树视图中使用过滤器来调用我从树视图中选择的县。我只想使用sql distinct语句并将县的值传递给treeview。



基本上是一回事,但哪种方式更好,为什么?



我尝试了什么:



如上所述,我只是这两种方式中的一种,我只是想知道哪两种方法更好。

So, I wanted to ask the people who have had quite a bit of experience in making databases. I was thinking of using a tree view control to help separate data into either tables through a connection string or using filters.

The data I am presented with is multiple state and county information. I was thinking about making the database be the state and then make each individual county be a table for that state, essentially I would have 50 databases.

I could also do 50 databases and 1 large table and use a filter in treeview to only call forth the county I pick from the treeview. I would just use a sql distinct statement and pass the values of the county into treeview.

essentially it is the same thing, but which way is better and why?

What I have tried:

As explained, I am only doing this one of two ways I just wanted to know which of the 2 ways are better.

推荐答案

引用:

我在考虑让数据库成为状态和然后让每个县成为该州的一个表,基本上我将有50个数据库。

I was thinking about making the database be the state and then make each individual county be a table for that state, essentially I would have 50 databases.





对我来说 - 听起来像是错误的做法。我建议阅读有关数据库规范化的内容。请参阅:

数据库规范化 - 维基百科 [ ^ ]

1NF,2NF,3NF和BCNF DBMS教程| Studytonight [ ^ ]

DBMS规范化 [ ^ ]



此时你必须把注意力放在数据库上结构并忘记显示该数据的组件。如果您想存储关于每个州和每个州的相同信息,您必须为国家和相关(1对多关系)创建一个表表。请参阅:

11重要的数据库设计我遵循的规则 [ ^ ]

十大常见数据库设计错误 - 简单谈话 [ ^ ]

关系数据库设计 [ ^ ]

数据库设计基础 - 访问 [ ^ ]



As to me - sounds like wrong approach. I'd suggest to read about database normalization. See:
Database normalization - Wikipedia[^]
1NF, 2NF, 3NF and BCNF in Database Normalization | DBMS Tutorial | Studytonight[^]
DBMS Normalization[^]

At this moment you have to move your focus on database structure and forget about components to display that data. If you would like to store the same information about each coutry and each state you have to create one table for countries and related (1 to many relationship) states table. Please, see:
11 important database designing rules which I follow[^]
Ten Common Database Design Mistakes - Simple Talk[^]
Relational Database Design[^]
Database design basics - Access[^]


第三种方式是最好的....有一个数据库有一个州的表和县的一个表。



The third way is the best....have one database with one table for state and one table for county.

State
-----
ID, Name

County
------
ID, StateID, Name





您稍后会感谢我们:)



You'll thank us later :)


这篇关于有关使用表格或过滤器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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