• 一次不愉快的作业合作经历

    数据库管理系统小组作业组内聊天记录展示,敏感信息已经隐去。一个“经典三人组”(一人做事、一人划水、一人捣乱)的例子。

    *

    不是大事,也不是首次遇到,唯一不同的是这回做了详细记录并公开。包含聊天记录和 canvas 讨论环节,除了一些不重要的图片、表情包,基本是没有遗漏。没有人犯下严重过错,点到为止。承诺永不公开进一步的隐私,若有敏感信息忘记隐藏,请联系。

    聊天记录

    ————— 2026-03-05 —————

    [本人] 21:27

    [组员 1] 23:19

    😃

    [组员 2] 23:19

    [Sticker]

    ————— 2026-03-07 —————

    [组员 2] 01:35

    我看了一下

    [组员 2] 01:35

    我们是不是需要在canvas里面建立一个group啊

    ————— 2026-03-08 —————

    [本人] 11:00

    刚注意到有这东西。不太懂这个系统是怎么回事,应该是随便选个数字加?

    [本人] 11:00

    https://example.com

    [本人] 11:02

    我在 *,*。

    [组员 2] 14:01

    我加了

    ————— 2026-03-09 —————

    [组员 1] 22:53

    我也加了[OK]

    ————— 2026-03-20 —————

    [本人] 23:12

    https://example.com

    作业要求昨天就出了,这个要求很有意思。每个人可以做个版本拿出来讨论,或者在别人的版本上改进,我个人觉得都可以。

    “You must also regularly record and maintain a diary of your group meetings and discussions on Canvas.” 平时讨论放在微信上,有些关键讨论请考虑放在 canvas 上,应该要用英语。

    https://example.com

    关于 Task 1,画图工具要统一(还在看,目前倾向于 drawio,或许有更好的),gemini 生成的内容也要统一(明天我可搞个,放在 canvas 上)。

    [组员 2] 23:13

    ok

    [组员 1] 23:15

    ok

    ————— 2026-03-21 —————

    [本人] 10:43

    有两个讨论已经发在 canvas 上。

    [组员 1] 19:13

    我这个周末看看

    ————— 2026-03-28 —————

    [本人] 12:14

    各位完成的如何?我已经基本实现了一个版本,请在 canvas 上查看。所有文件不要分享。

    [组员 2] 15:36

    好的

    [组员 2] 15:36

    我加快

    [组员 1] 20:12

    刚看了一下canvas里面你发的@*

    [组员 1] 20:12

    现在是怎么搞,每个人独立完成一份?还是在你的那个基础上修改

    ————— 2026-03-29 —————

    [本人] 07:44

    我不知道你们的状态如何,两者都行。如果都刚开始,可能修改会更加合适。

    具体可做什么,请看我在 canvas 上的提示。也可自行对比作业要求。

    作业靠自觉。

    [组员 1] 15:32

    我不知道还有什么大活要干的,感觉你已经把活基本干完了。在你的基础上修改的话,最后拿不到贡献分。

    [组员 1] 15:33

    按我理解是一人画er,一人画rm,一人写代码 这样子。

    [本人] 15:34

    有的,好好看作业要求,有些我还没做。

    [本人] 15:35

    我搞东西是否有问题,也可检查。

    [本人] 15:35

    写测试都可以。

    [组员 1] 15:36

    我请您指示一下还有哪些活

    [本人] 15:36

    你作业要求看了吗?

    [组员 1] 15:36

    看了

    [组员 1] 15:37

    看了

    [本人] 15:37

    比如讨论 gemini 的设计有什么问题。

    [本人] 15:37

    这个在 discussion 上我也是有提示的。

    [组员 1] 15:38

    我觉得这些和你已经做的相比没什么工作量

    [本人] 15:38

    绘制 rm 图。

    [组员 1] 15:38

    到时候写分工怎么写?

    [组员 1] 15:39

    感觉你一人占整个工作量一大半了

    [本人] 15:39

    态度没问题,不要担心什么贡献分。

    写测试也是可考虑的。

    [组员 1] 15:42

    那您给我指派一下和您工作量相当的工作,我去完成。既然你这么喜欢supervise的话。

    [本人] 15:43

    插入的 sql 我是制定框架,让 ai 生成数据。这虽然感觉问题不大,但是否会被认为违规,我要研究一下。

    可以帮忙手动写一下,这样就完全没问题了。

    [本人] 15:43

    不,我不喜欢 supervise。我只是把我的进度公开了而已。

    [本人] 15:44

    我不会要求组员做什么,一切靠自觉。

    [组员 1] 15:44

    那请您给我指派一下和您工作量相当的工作,我去完成。我不想最后没有贡献分。

    [本人] 15:45

    不必担心这个,认真搞,哪怕只有一点,贡献分都会给全。

    [本人] 15:46

    不要紧张,轻松一点。

    [组员 1] 15:46

    难以放心。老师是会这样的吗?

    [组员 1] 15:46

    我还是觉得三个人在事实上工作量相当比较合适。

    [本人] 15:48

    没人会在意工作量相当这种事。安心。

    [组员 1] 15:49

    @* 你的意见呢

    [组员 2] 15:49

    不好意思刚醒😅

    [组员 2] 15:56

    我觉得还是尽量分配的平均好些吧,毕竟这个不是说一个人弄完,大家都能得分。如果说实在不放心其他的人部分,可以最后大家一起discussion讨论一下,说一下那个部分可以在改进一下这样

    [组员 2] 16:00

    主要是老师并没有明确的说过贡献怎么算的的问题,所以我觉得保险一点还是五五分吧

    [本人] 16:03

    能这么积极为小组做贡献非常好。那么这样,之前提到未完成的部分都认领一下?Canvas 上也最好回复一下讨论?老师若一定想查,应该是看 canvas 的。

    [组员 2] 16:06

    ok,不好意思有点拖

    [组员 1] 16:06

    。。。

    [组员 1] 16:06

    依照你的进度,还有哪些未完成的,你把所有的罗列一遍

    [本人] 16:15

    讨论 gemini 的设计有什么问题。 绘制 rm 图(用 drawio)。 基于 a1-insert.sql 手动写一下事务插入的脚本。 编写脚本测试,约束是否正常工作。 做的过程中验证一下设计。

    仅供参考,选重了没问题。若进度不及预期,其它组员也可介入。

    [组员 2] 16:17

    那我就倒着来

    [组员 1] 18:06

    嗯我正着来

    ————— 2026-04-13 —————

    [本人] 14:32

    看到了有人发了 rm 图,注意 rm 图是 task 2,要按照我们自己的设计画,而不是 ai 的。

    [本人] 14:41

    剩余内容请尽早发出来,完成度有限也没关系,如果比较忙有其他事情也可私下通知。早点把这解决掉。

    [组员 2] 14:42

    抱歉,今天我有一门课有期中考试,这两天都在准备这个。考完后我会尽快把剩余附上

    [本人] 14:50

    到某个时间点我就开始整理,请给我留点时间,太晚发的东西就不收了。专心考试,加油。

    至于这个作业不用太担心,声明贡献分的时候我都给满,老师估计也不会查,没人配合查也查不了。

    [组员 1] 18:32

    就是按照一开始的domain description画的

    [组员 1] 18:33

    当然有的地方也需要讨论

    [本人] 18:49

    https://example.com 用这个图。

    [组员 1] 19:57

    你这图不是加了很多additional entity set

    [组员 1] 19:59

    和初始描述差别有点大,contract 和 performance作为entityset我觉得太冗余。

    [组员 1] 20:00

    另外几乎所有entityset都加了id这个主键。初始描述里并不能derive出这么多信息。

    [本人] 20:10

    可以给出你自己的版本,说明理由。至于 id 这个,如果不加,你觉得应该拿什么作为主键?

    [本人] 20:11

    注意,理由要从业务的角度考虑。

    [组员 2] 20:11

    id前面加个前缀也不行吗

    [组员 1] 20:22

    比方说equipment,应该是一个人一个equipment,那主键就是athlete的主键

    [组员 1] 20:24

    To provide further service to IOMC’s athletes, each athlete must select between 1 and 5 specialized medical packages that better match their personal needs. These options include physiotherapy, nutritional plans, and recovery sessions.

    那physiotherapy, nutritional plans, and recovery sessions这些名称可以作为package的主键

    [本人] 20:30

    是否有提到一个人只能有一个装备?

    这三项是类别,不可能作为主键的。

    [本人] 20:31

    注意这里提到一到五个,而且用了复数。

    [组员 1] 20:31

    再比如club,这个也要作为entityset吗?直接和amateur合在一起成一个entity set就行了,因为amateur和club是n to 1 并且full participation的,不管er怎么画,rm都是只画一个amateur,更何况初始描述更倾向于把 club and its location 作为amateur的attributes

    [本人] 20:32

    因为 club 和人 是多对多的关系。

    [组员 1] 20:33

    那就和athlete组成一个m 头

    [组员 1] 20:33

    m to n关系啊

    [组员 1] 20:35

    These options include…也就是说运动员只能在下面这些选项里面选,我理解是这样的

    [本人] 20:35

    可以选 5 个,怎么会只有三个选项呢?

    [组员 1] 20:38

    Each medical package is described by name and description

    [本人] 20:38

    这两个我应该都加了。

    [组员 1] 20:38

    那呀不就把这两个作为复合主键,或者就一个name。我不觉得平白无故多个id是合适的

    [本人] 20:39

    工程上建议用数字作为主键呢。而且也没必要假设 name 必须是 unique。

    [组员 1] 20:46

    。。。

    [本人] 20:47

    刚才凭印象答的,记错了。是一对多。

    [本人] 20:47

    一对多也是要独立成实体的,不建议直接用数组。

    [本人] 20:48

    还有什么疑问需要我回答吗?

    [组员 1] 20:50

    faithful to domain description.我不太理解你说的业务需求,以及非数字主键是不是完全不合法的。如果你坚持这样,可以自己修改rm图,或者由@* 定夺。修改rm图需要你们发Google账号给我。

    [组员 1] 20:51

    我从来没有在提问你,是质询。

    [本人] 20:51

    Once both parties agree on the terms, the registration is finalized, and the system records the base stipend, bonus amount, and final stipend of the contract, along with the signing date.

    Contract 还是建议用实体呢。Registration 也可以,这个只是业务逻辑上有区别。个人偏好 Contract,未完成的注册不应该直接放入数据库。

    [本人] 20:51

    有质疑非常好。

    [本人] 20:52

    当然是合法的,只是不建议,而且需要假设 unique。

    [本人] 20:53

    至于 performance,是为了计算运动员 performance bonus,实现比赛成绩相关的业务逻辑。

    [组员 1] 20:53

    Each medical package is described by name and description。按我对英语的理解,这句话暗含name并上description是unique的,并且可以作为主键。

    [本人] 20:55

    这问题你可以问 AI 吧,如果你觉得我还不够权威。

    [组员 1] 20:55

    ai说我说的没问题

    [本人] 20:55

    建议发出来看看。

    The chat history for the Weixin group 数据库管理系统小组 is as follows. Check it.

    [组员 1] 21:06

    这是一个非常经典的模型设计争论:代理键(Surrogate Key,如 ID) vs. 自然键(Natural Key,如 Name)。

    在 * 的数据库课程要求中,通常强调的是“忠于需求描述(Faithful to the requirements)”。你可以从以下几个角度和组员沟通,并给出一个既还原题目又保证工程严谨的折中方案。

    1. 沟通术语与逻辑 你可以用这些英语表达来反驳或讨论:

      Faithfulness to Domain Description: 还原题目描述。

      Natural Key vs. Surrogate Key: 自然键 vs. 代理键。

      Explicitly stated: 明确提到。

      建议跟组员这么说:

      “I understand that adding an ID is a common practice for efficiency, but the domain description explicitly states that each package is ‘described by name and description’. In database modeling, if a natural key like name is sufficient and implied by the requirements, adding a surrogate ID might move us away from being faithful to the domain.”

    2. 深度解析:为什么 Name 可能是更好的选择? 根据你上传的图片(image_bcb30b.png),题目说:

      “Each medical package is described by name and description.”

      题目暗示: 既然没提 ID,且在一个医疗系统(IOMC)里,医疗套餐的名字(如 “Physiotherapy”, “Recovery Session”)通常在业务逻辑上就是唯一的。

      RM 图的还原度: 在 RM 图中,主键(PK)应该反映现实世界中的实体标识。如果题目没写 ID,你强加一个 ID,Tutor 可能会认为你没有仔细阅读需求。

    [组员 1] 21:10

    在这个数据库建模的问题上,我更倾向于支持你组员的观点(使用 ID 作为主键),但在逻辑建模的阶段,你的出发点也是有价值的。

    为了帮你更好地完成作业并说服(或被说服)组员,我们可以从数据库设计原则和业务逻辑两个维度来分析:

    1. 为什么你的组员建议使用 ID(代理主键)? 在工业界,使用自增数字(Auto-increment)或 UUID 作为主键(Surrogate Key)是主流做法,原因如下:

      稳定性: 主键一旦设定就不应该更改。如果使用 name 作主键,万一以后要把 “Physiotherapy” 改名为 “Physical Therapy”,所有关联到这张表的“运动员-医疗包”中间表的外键全都得跟着改,这会导致巨大的性能开销和数据一致性风险。

      存储效率: 整数(INT/BIGINT)在数据库索引中的查询效率远高于字符串。字符串越长,索引占用的磁盘和内存就越多。

      唯一性保障: 描述(Description)通常很长且可能包含特殊字符,将其作为主键或复合主键的一部分是非常糟糕的实践,这会导致关联表变得极其臃肿。

    2. 为什么你的想法在“建模初期”是合理的? 你提到的“忠于原描述”其实是 概念模型(Conceptual Model) 的思维。

      在需求分析阶段,我们确实关注业务实体属性。如果描述里没写 ID,说明在业务人员眼里,name 就是识别它的方式(候选键)。

      但是,逻辑模型和物理模型需要考虑现实的系统实现。在数据库中,我们追求的是“高内聚、低耦合”。

      与ai的另一个聊天显示用id作主键是合理的

    [本人] 21:18

    两个长字符串的复合主键性能非常差且不稳定。selection 表也要记录 package name 和 description 就更糟糕了。

    ai 说的基本是可以的。但是有一点要指出,题目没明确说 name 和 description 组合必须是唯一的,在概念上也未必合适。id 是非常常见的代理主键设计,在概念上更为合理。

    [本人] 21:19

    在业务上,改名字和描述也是常见的需求。

    [组员 1] 21:21

    。。。行,关于package我会依照 业务需求 对rm图进行改动

    [组员 1] 21:22

    equipment应该是弱实体,这个没问题吧

    [本人] 21:27

    其实这些问题我想得是比较深的,建议还是不要依附于运动员作为弱实体。

    逻辑上装备是不依赖于运动员的。一个装备可以给多人使用,尤其是对于团体运动。而且装备中,有装备检查的业务逻辑,这个更加独立于运动员。(运动员删除检查记录应该留存。)

    题目中提到团队比赛和个人比赛,我这套方案其实是可以完全兼容团队比赛的逻辑,可以作为加分项。

    [组员 1] 21:34

    own specialied equipment,也就是说equipment对athlete是1对1的,比方说某球员的球拍是一个equipment。

    [组员 1] 21:36

    都own specilized了逻辑上还不依赖吗。你图里应该有个表示1to1的加粗箭头。

    [本人] 21:40

    起码是一对多,不知道你是怎么看出一对一的。一个人肯定能有多个装备。

    不讨论业务上的逻辑, own 未必暗示只能被一个人拥有。

    至于为了保持装备独立性,不建议用加粗。

    [本人] 21:43

    你先把想法和 ai 讨论吧,ai 搞不定或者和我意见不一致再问我好了。避免诱导性提问,你刚才正反两面都做了,这非常好。

    [组员 1] 21:50

    1. 多个装备就当成一个entry啊,一个人带的装备登记在equipment里面形成一行,这很难理解吗。
    2. 无论是n对1还是1对1你图里的箭头都missing了,需要修改。
    3. 为什么不是你自己去问ai。如此权威吗。我诱导啥了

    [组员 1] 21:51

    避免命令组员。

    [本人] 21:56

    唉,你呀,加油吧。

    [组员 1] 21:58

    😳

    [组员 1] 21:58

    完了我落后了

    [组员 1] 21:59

    目前唯一诉求就是你停止像上司一样讲话@*

    [本人] 22:00

    好的,我不说话了,有事 canvas 聊吧。

    [组员 1] 22:02

    并非,canvas上也像我上司。

    Canvas 讨论

    Choosing a Tool for ER and RM Diagrams

    [本人]

    Posted Mar 21 9:53 4 Replies 4 Replies Discussion Topic: Choosing a Tool for ER and RM Diagrams

    Our group should agree on a common tool for drawing ER diagrams and RM diagrams. The instructor recommended tools like draw.io, Microsoft Visio, Lucidchart, and Excalidraw. What do you all think? Please make sure to follow the diagramming standards taught in class.

    [本人]

    Mar 21 21:52 | Last edited Mar 23 15:46 | Last reply Mar 29 16:29View History Reply from [本人]

    Ideally, the tool should meet the following requirements, in order of priority:

    1. Free.
    2. ER and RM diagram styles consistent with the course, see https://example.com.
    3. Constraint validation, and ideally automatic generation, for both the ER -> RM and RM -> DDL stages.
    4. Code generation suitable for long-term maintenance.

    Achieving all of these is very difficult and will require trade-offs.

    [本人]

    Mar 21 23:46 | Last edited Mar 21 23:47View History Reply from [本人]

    I have come up with a plan that uses two tools to complete the assignment.

    • For diagramming, I recommend draw.io Links to an external site., which has built-in shape libraries that satisfy requirements 1 and 2. It is available as an online service, a VSCode extension, and a native desktop application.
    • For code generation, I suggest pgAdmin 4 Links to an external site., which satisfies requirement 1 and partially satisfies requirements 3 and 4. This software should already be installed.

    The workflow is: first use pgAdmin 4’s ERD tool to design the schema and verify correctness, then redraw the ER and RM diagrams in the required style using draw.io, and automatically generate the DDL.

    [组员 1] Mar 28 20:23 Reply from [组员 1]

    Fine. I’ll go with draw.io and pgAdmin.

    [组员 2] Mar 29 16:29 Reply from [组员 2]

    Copy that. I’ll use draw.io and pgAdmin 4 as my tools.

    Textual Representation of the ER Diagram Generated by Gemini

    [本人]

    Posted Mar 21 10:39 5 Replies 5 Replies Discussion Topic: Textual Representation of the ER Diagram Generated by Gemini

    Please use this conversation as the standard. It should not be modified unless there is a strong justification.

    https://example Links to an external site.

    The following is the response from Gemini 3.0 (free version, fast mode).

    *

    screencapture-gemini-google-share-eafb7dfb0238-2026-03-21-10_30_11.png

    [本人]

    Mar 21 10:49 Reply from [本人]

    Gemini has some rendering issues. Content enclosed in <u></u> should be underlined, indicating primary keys.

    [本人]

    Mar 28 11:43 Reply from [本人]

    I have completed one version. Gemini’s response contains some contradictions, and since ER diagram design has a high degree of flexibility, there is not a single correct answer.

    IMPORTANT! Do not share this graph with anyone outside the group.

    watermarked_a1-erd-gemini.png

    Please check whether this diagram aligns with Gemini’s design and discuss the shortcomings of Gemini’s approach.

    [组员 2] Mar 29 17:02 Reply from [组员 2]

    In the Management & Safety part, Gemini shows Sponsorship_Payment can be modeled as an associative entity or a relationship between Athlete and a Sponsor(implied). Although Sponsor is implied, I reckon it should be defined.

    [组员 1] Mar 30 3:59 | Last edited Mar 30 4:00 Reply from [组员 1]

    Analysis of the issues in the generated ERD text output

    Comparing the ERD text output from Gemini with the provided domain description, I have identified the following issues in the former.

    1. Conduct_Details should be an entity set, its attributes being Mobile_number, Email_Address, and Passport_Number, where Passport_Number is the primary key. The entity sets Conduct_Details and Athlete should be associated via a relationship Has and every entity of the two entity sets participates in exactly one instance of the relationship.
    2. Travel_Stipend should be a weak entity set, its attributes being Signing_Date, Base_Stipend, Bonus_Amount and Final_Stipend, where signing date is the discriminator. The entity sets Travel_Stipend and Athlete should be associated via a relationship Registers_For, who has two additional attributes Performance_Bonuses and Housing_Cost, and every entity of Travel_Stipendi participate in at least one instance of Registers_For.
    3. What is the primary key of the entity set Trial? Name? Trial ID? It seems that it is not clearly stated in the domain description and this should be discussed. Also there should be an additional constraint in the relationship Participates_In, namely there should be exactly one instance in Participates_In, given the value of AthleteID and Date. See: “The athlete will compete in at least one trial during the games.” and “We assume that an athlete can only sign up for one single event per day but may sign up for additional events on other days at the trials.”
    4. I think there should be an attribute Is_Allowed belonging to Equipment, which is derived from Safety_Status.
    5. The last paragraph of the domain description states ” To accommodate different funding needs, IOMC offers multiple sponsorship payment options to each athlete which include corporate sponsorship, government grants, or private donations. IOMC also records the amount and date of each sponsor’s payment.”, which I think is not clear enough. If we create an entity set Sponsor, then we have to decide a primary key for it, say, SponsorID. This should be discussed.

    That’s all I’ve got for now.

    [本人]

    Mar 30 10:00 | Last edited Mar 30 10:12View History Reply from [本人]

    I have read through your discussion and have two points to share.

    • I agree that some of the primary key designs could be reconsidered. Feel free to suggest alternatives to clarify your ideas.
    • The assignment actually specifies two versions: a full implementation for us to build, and a simplified prompt for the AI. Since much of the information was not provided to the AI, it is not fair to evaluate it using the full-version requirements. I feel the AI may have some inconsistencies and areas where it does not meet the prompt. Would someone experienced be able to point them out?

    Complete Design of the IOMC System

    [本人]

    Posted Mar 28 11:50 | Last edited Apr 3 11:08 3 Replies 3 Replies Discussion Topic: Complete Design of the IOMC System

    Everyone can publish their own implementation here or improvements on others’ work. Please provide the ER diagram and SQL code. The remaining parts can be completed once the final version is decided.

    [本人]

    Mar 28 12:08 | Last edited Mar 28 12:12 | Last reply Mar 28 12:09View History Reply from [本人]

    IMPORTANT! Do not share this graph with anyone outside the group.

    watermarked_a1-erd.png a1.sql

    [本人]

    Mar 28 12:09 Reply from [本人]

    This script may help you understand. a1-insert.sql

    [本人]

    Apr 3 11:18 | Last edited Apr 3 11:18View History Reply from [本人]

    If you want to base your work on my implementation, you can write test scripts and create the corresponding RM diagram. Hope to finish the remaining assignments before the midterm break ends.

    RM diagram finished.

    [组员 1]

    Posted Apr 8 2:45 2 Replies 2 Replies Discussion Topic: RM diagram finished.

    Hi group members. I have finished the RM diagram part of our task, based on the domain description and the ER diagram. Only entity sets and M-N relationships are transformed into relations, while 1-N relationships are represented by adding attribute(s) of the 1 side relation to the N side relation and then creating a foreign key.

    I have uploaded the original editable .drawio file to my google drive. You can make revisions to the diagram after you tell me your google account numbers, if you would like to. However, do inform me before you make a revison to the diagram.

    The RM diagram cannot convey all the information of the domain description, so we still need the domain description and ER diagram when implementing the database in pgAdmin. How’s the DDL implementation going?Have you already finished it? RMDiagram.drawio.png

    [组员 1]

    Apr 8 2:46 Reply from [组员 1]

    RMDiagram.drawio.png

    [本人] Apr 13 14:23 | Last edited Apr 13 14:31View History Reply from [本人]

    • The RM diagram is part of Task 2, which should be based on our own design rather than one generated by AI.
    • Arrows should always point from FK to unique attribute.
    • Ensure that the arrow style is consistent throughout.
    • You have additionally included constraints, namely NOT NULL, UNIQUE, and derived attributes; this is acceptable but not necessary.