哪种方法? (与表格共用) [英] which approach? (cofused with tables)

查看:49
本文介绍了哪种方法? (与表格共用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在设计一个视频和游戏租赁数据库。


我有客户表,所有正确和相关的细节。

我有一部电影和游戏桌。


但是我很困惑以哪种方式链接他们。


例如

a custoemr可以租一个视频和一个游戏,但我必须分开吗

''租赁的每个类别的桌子,或1个桌子,两个租金?





我有租赁桌, (只有id和截止日期)

并且有单独的视频租赁和游戏租赁表?


我创建了一个错误的图表,我应该使用哪一个?我没有附上它,

但如果somone愿意帮助我解决这个小问题我可以。


thanx


devin

解决方案

使用包含您出租的所有标题的标题表(包括游戏和

视频)。包括一个TitleType字段,以区分它是什么。


当然,你可能有一个标题的多个副本。你不会向你的客户雇用

标题,但是实例(特定的磁盘,可能是b $ b上有一个独特的条形码。)因此,您将拥有一个产品表格

包含您租用的所有物品。它将包含以下字段:

ProductID AutoNumber主键

TitleID与Title表的主键相关(什么标题

this是。)

PurchDate日期/时间当您购买此实例时。

无效是/否如果此副本丢失或

已损坏,则标记无效。


您将需要租用表:

HireID自动编号主键

ClientID与客户表的主要关联密钥(谁雇用了这个。)

HireDate日期/时间当这个雇佣被取出时。

和一个HireDetail表(对于这个招聘中的所有项目):

HireDetailID自动编号主键

HireID编号。与雇用表的主键相关。

产品ID号雇用了什么物品。

到期日期/时间此项目到期时。

收费货币客户收取多少费用

此项目。


-

Allen Browne - Microsoft MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" DP" < DP@hotmail.com>在消息中写道

news:Se ****************** @ newsfe2-win.ntli.net ...


我正在设计一个视频和游戏租赁数据库。

我已经有了客户表,包含所有正确和相关的详细信息。
我已经有一部电影和游戏桌。

但是我很困惑用哪种方式链接它们。

例如
一个客户可以租一个视频和一个游戏,但是我必须为每个类别或1张桌子分别设置一个单独的租赁桌子,用于租金吗?



我有一个租赁桌,(只有身份证和到期日),并且有单独的视频租赁和游戏租赁桌吗?

我已经创建了一个错误的图表,其中我应该用哪一个?我还没有附上它,
但如果somone愿意帮助我解决这个小问题,我可以。



每DP :



我正在设计一个视频和游戏租赁数据库。




你看过吗什么是现成的?


听起来像是一个面包和黄油的应用程序之一,你可以得到

准备好的东西 - 这样做可以实现你想要的成本的90%

你自己。

-

PeteCresswell


每DP:

我正在设计一个视频和游戏租赁数据库。




针对面向对象编程的WROC操作方法书之一使用视频租赁

作为其中一个示例的主题。


我的回忆是作者的姓氏有一个美洲印第安人的声音
$ b $它 - 像Lahota。


也许别人可以回想起这个头衔。

-

PeteCresswell


hi,

i''m designing a video and games rental database.

i''ve got the customer table, with all the correct and relavant details.
i''ve got a films, and games table.

But i''m confused which way to link them.

e.g.
a custoemr can rent a video and a game, but do i have to have a seperate
''rental'' table for each category, or 1 table, for both fo the rents?

or

do i have a rental table, (with just the id, and due dates,)
and have seperate video rental and game rental tables?

i''ve created an erd diagram, which one should i use? i have not attached it,
but i could if somone is willing to help me slove this little problem.

thanx

devin


解决方案

Use a Title table that contains all the titles you hire out (both games and
videos). Include a TitleType field, to distinguish which it is.

Of course, you might have multiple copies of one title. You don''t hire
Titles to your customers, but instances (a particular disk, that probably
has a unique barcode on it.) You will therefore have a Product table which
contains everything you have for hire. It will have fields such as:
ProductID AutoNumber Primary key
TitleID relates to the Title table''s primary key (what title
this is.)
PurchDate Date/Time When you bought this instance.
Inactive Yes/No Mark inactive if this copy is lost or
damaged.

You will then need the Hire table:
HireID AutoNumber Primary key
ClientID Relates to Client table''s primary key (Who hired this.)
HireDate Date/Time When this hire was taken out.
and a HireDetail table (for all the items in this hiring):
HireDetailID AutoNumber primary key
HireID Number. Relates to primary key of Hire table.
ProductID Number What item was hired.
DueDate Date/Time When this item is due back.
Charge Currency How much the client is charged for hiring
this item.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"DP" <DP@hotmail.com> wrote in message
news:Se******************@newsfe2-win.ntli.net...


i''m designing a video and games rental database.

i''ve got the customer table, with all the correct and relavant details.
i''ve got a films, and games table.

But i''m confused which way to link them.

e.g.
a custoemr can rent a video and a game, but do i have to have a seperate
''rental'' table for each category, or 1 table, for both fo the rents?

or

do i have a rental table, (with just the id, and due dates,)
and have seperate video rental and game rental tables?

i''ve created an erd diagram, which one should i use? i have not attached
it,
but i could if somone is willing to help me slove this little problem.



Per DP:

hi,

i''m designing a video and games rental database.



Have you looked into what''s available off-the-shelf?

Sounds like one of those bread-and-butter applications where you can get
something ready-made that does 90% of what you want for 10% of the cost of doing
it yourself.
--
PeteCresswell


Per DP:

i''m designing a video and games rental database.



One of the WROC How-To books for object-oriented programming uses video rental
as the subject of one of their examples.

My recollection is that the author''s last name had an American Indian sound to
it - something like Lahota.

Maybe somebody else can recall the title.
--
PeteCresswell


这篇关于哪种方法? (与表格共用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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