“会议”的关系包括:清单 [英] Relationships for "Meetings" List

查看:57
本文介绍了“会议”的关系包括:清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个人表,而我有一个会议表,其中有两个列:Person1_ID和Person2_ID。

I have a "people" table, and I have a "meetings" table, where there are two coloumns: Person1_ID and Person2_ID.

使用Person2_ID(也是 people表中的另一个人)的person1_ID(此人是人之一)开会的会议的输入已完成。但是,这也意味着Person2_ID也正在与Person1_ID会面。换句话说,这是一种双向关系。

When I set up a meeting for person1_ID (the person is one of the "people") with Person2_ID (also, another person from the "people" table) the entry for the meeting is complete. However, this also means Person2_ID is meeting with Person1_ID as well; in other words, this is a two sided relationship.

如何查询每个人的会议?在表单中,我想分别显示每个人的会议,但是我不确定如何从会议表中提取信息。

How can I query "meetings" per each person? In a form, I want to display the "meetings" fpr each person separately however I'm not sure how I can pull the information out from my "meetings" table.

推荐答案

我认为您会发现您当前的设计可能不足以对现实生活中的会议管理需求进行建模。

I think your will find that your current design is probably not adequate for modelling the requirements of meeting management in real life.

最基本的是:


  • 会议是一个单独的事件,具有位置,时间,持续时间和描述。

  • 可以有多个人参加会议。

从这两个简单的要求中,您可以看到,对于一个会议记录,您需要能够关联多个记录,而不仅仅是2个。

From these 2 simple requirements, you can see that, for a single meeting record, you need to be able to associate multiple People records, not just 2.

像这样建模:

Meetings table                  MeetingsPeople table
------------------------        -----------------------
ID  (PK)        AUTONUMBER  ->  MeetingID (FK)   NUMBER
Description     TEXT            PersonID  (FK)   NUMBER
Location        TEXT
DateTimeStart   DATETIME
Duration        NUMBER

MeetingsPeople 表非常简单:用于将给定的人链接到给定的会议。

这将消除您的限制。现在,您可以根据需要召开会议,而不仅仅是2人。

The MeetingsPeople table is very simple: it is used to link a given person to a given meeting.
This will remove the limitation you had. Now you can have as many people as needed for a meeting, not only 2.

如果您要记录发起会议的人或其他参与者确认出席的人,您可以将其添加到 MeetingsPeople 表中:

If you want to record who initiated the meeting or if the other participants confirmed their attendance, you can add that to the MeetingsPeople table:

MeetingsPeople table
-----------------------
MeetingID (FK)   NUMBER
PersonID  (FK)   NUMBER
IsMeetingOwner   YES/NO
IsConfirmed      YES/NO

创建新的会议时记录,您还需要在 MeetingsPeople 中创建一个新记录,该记录链接到会议的所有者。

When you create a new Meetings record, you also need to create a new record in MeetingsPeople that links to the owner of the meeting.

要查询给定人员正在参加的所有会议(例如生成会议时间表),您只需一个简单的查询即可。

John Doe People 表中具有 123 ID 想知道他今天应该参加的所有会议:

To query all meetings being attended by a given person (to generate their schedule for instance) all you need is a simple query.
Say that John Doe has and ID of 123 in the People table and we want to know all the meetings he should attend today:

SELECT Meetings.*
FROM   Meetings
INNER JOIN MeetingsPeople
  ON MeetingsPeople.MeetingID = Meetings.ID
WHERE MeetingsPeople.PersonID = 123
      AND DateTimeStart >= Date()
ORDER BY DateTimeStart;

这篇关于“会议”的关系包括:清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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