需要帮助来定义表关系,以便我可以使用ADO来创建数据库 [英] Need help to define table relations so I can use ADO to create database

查看:56
本文介绍了需要帮助来定义表关系,以便我可以使用ADO来创建数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我想首先感谢所有花时间查看此主题并尝试提供帮助的人。



我必须使用具有以下特征的表创建数据库:



1.)TableMaster(#PK_Master,... , NameOfBookStore TypeOfGeothermalEnergy);



2.) NameOfBookStoreTable TypeOfGeothermalEnergy( TotalAmountOfBooks TotalAmountOfProbes [n], TitleOfTheBook DepthOfTheProbe [1], TitleOfTheBook DepthOfTheProbe [2],..., TitleOfTheBook DepthOfTheProbe [n]);



上面的定义是我的伪代码,试图解释我的问题。



这是我的问题:



如何将伪代码转换成真正的数据库关系?



*** *********************************



SIIDENOT E:



我的个人意见是,我需要将第二个表分成两个关系,我在想这样的事情:



TableMaster(#PK_Master,..., NameOfBookStore TypeOfGeothermalEnergy);



NameOfBookStoreTable TypeOfGeothermalEnergy(#(PK_Master, OrdinalNumberOfTheBook OrdinalNumberOfTheProbe), TotalAmountOfBooks TotalAmountOfProbes [n]);



HelperTable (# OrdinalNumberOfTheBook OrdinalNumberOfTheProbe, TitleOfTheBook DepthOfTheProbe);



但我只是没有足够的知识/经验有了数据库设计,所以我需要社区帮助。



这就是全部,再次,我要感谢任何试图提供帮助的人。



***************************************



如果需要任何其他信息,请索取它,我将非常乐意提供它。

Hello everyone!

I would like to start by saying thanks to everyone who takes some time to view this thread and try to help.

I have to create database with tables that have following characteristics:

1.) TableMaster( #PK_Master, ... , NameOfBookStore TypeOfGeothermalEnergy );

2.) NameOfBookStoreTable TypeOfGeothermalEnergy( TotalAmountOfBooks TotalAmountOfProbes[n], TitleOfTheBook DepthOfTheProbe[1] , TitleOfTheBook DepthOfTheProbe[2] , ... , TitleOfTheBook DepthOfTheProbe[n] );

The above "definition" is my pseudo-code, that tries to explain my problem.

This is my question:

How to turn that pseudo-code into real database relations ?

************************************

SIIDENOTE:

My personal opinion is, that I need to break the second table into 2 relations, I was thinking something like this:

TableMaster( #PK_Master, ... , NameOfBookStore TypeOfGeothermalEnergy );

NameOfBookStoreTable TypeOfGeothermalEnergy( #( PK_Master, OrdinalNumberOfTheBook OrdinalNumberOfTheProbe ) , TotalAmountOfBooks TotalAmountOfProbes[n] );

HelperTable( #OrdinalNumberOfTheBook OrdinalNumberOfTheProbe, TitleOfTheBook DepthOfTheProbe );

but I just don't have enough knowledge/experience with database design, so I need communities help with this.

That is all, again, I wish to thank anyone who tries to help.

***************************************

If any other information is required , please ask for it, I will more than gladly supply it.

推荐答案

我希望我有一张书桌。然后一个表列出书店。然后是一个具有商店ID,书籍ID和日期的表格。该表格可能还会存储它的成本。将列出销售量和销售日期。计算进来但未售出的书籍,会给你库存的全书。



好​​吧,我仍然觉得它很相似。列出能量类型的表格。列出探针的表。一个表格,用于链接两者并存储特定探针的深度。一个活动标志,以便您可以根据需要使一些不活动。然后通过执行SUM查询来获得总计数。
I would expect I'd have a table for books. Then a table listing book stores. Then a table that has the id of a store, the id of a book, and the date it came in. That table would probably also store how much it cost. There would be a column for how much it sold for and the date it sold. Counting books that came in and have not sold, would give you the total books in stock.

OK, I still think it's similar. A table listing types of energy. A table listing probes. A table that links the two and stores the depth of the specific probe. An active flag so you can make some inactive, if you need to. Then you get the total count by doing a SUM query.


这篇关于需要帮助来定义表关系,以便我可以使用ADO来创建数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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