You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何根据指定业务规则绘制实体关系(ER)图?

ER Diagram for Sports Event Management

Entities & Attributes

  • 球员 (Player)

    • player_id (PK): Unique identifier for the player
    • full_name: Player's full name
    • position: Playing position (e.g., forward, defender)
    • date_of_birth: Player's date of birth
    • team_name: Current team the player belongs to
  • 赛事 (Match)

    • match_id (PK): Unique identifier for the match
    • match_name: Name/title of the event (e.g., "2024 Premier League Final")
    • match_date: Date and time of the match
    • venue: Location where the match is held
    • match_type: Type of event (e.g., league, cup, friendly)
  • 裁判 (Referee)

    • referee_id (PK): Unique identifier for the referee
    • full_name: Referee's full name
    • certification_level: Official certification grade (e.g., FIFA Elite, National)
    • contact_email: Referee's professional contact email
    • years_of_experience: Number of years officiating
  • 主办方 (Organizer)

    • organizer_id (PK): Unique identifier for the organizer
    • organizer_name: Name of the organizing body (e.g., "FA Premier League")
    • office_address: Physical address of the organizer's office
    • contact_person: Name of the main contact at the organizer
  • 联合会 (Federation)

    • federation_id (PK): Unique identifier for the federation
    • federation_name: Name of the governing federation (e.g., "FIFA", "UEFA")
    • country: Country where the federation is based
    • headquarters: City of the federation's headquarters

Relationships

  1. 球员参与赛事 (Many-to-Many)

    • A player can participate in multiple matches; a match involves multiple players
    • Junction table: Player_Match
      • player_id (FK), match_id (FK) (composite PK)
      • jersey_number: Player's jersey number for the match
      • participation_status: Whether the player started, came on as substitute, etc.
  2. 赛事由裁判执裁 (Many-to-Many)

    • A referee can officiate multiple matches; a match has multiple referees (main, assistant, VAR)
    • Junction table: Referee_Match
      • referee_id (FK), match_id (FK) (composite PK)
      • referee_role: Specific role in the match (e.g., "Main Referee", "Assistant Referee 1", "VAR")
  3. 主办方组织赛事 (One-to-Many)

    • One organizer can arrange multiple matches; each match is organized by exactly one organizer
    • Foreign key: match.organizer_id (FK referencing organizer.organizer_id)
  4. 主办方向裁判支付报酬 (Ternary Relationship)

    • Payment is tied to a specific match officiated by a referee, organized by an organizer
    • Junction table: Payment
      • payment_id (PK)
      • organizer_id (FK), referee_id (FK), match_id (FK)
      • payment_amount: Amount paid to the referee
      • payment_date: Date the payment was processed
  5. 裁判由联合会任命 (One-to-Many)

    • One federation appoints multiple referees; each referee is appointed by exactly one federation
    • Foreign key: referee.federation_id (FK referencing federation.federation_id)

Text-Based ER Diagram Representation

[Player] <|-->> [Player_Match] <<--|> [Match]
[Match] <<--|> [Organizer]
[Match] <|-->> [Referee_Match] <<--|> [Referee]
[Referee] <<--|> [Federation]
[Organizer] <|-->> [Payment] <<--|> [Referee]
[Payment] <<--|> [Match]

Entities with attributes:
Player (player_id*, full_name, position, date_of_birth, team_name)
Match (match_id*, match_name, match_date, venue, match_type, organizer_id)
Referee (referee_id*, full_name, certification_level, contact_email, years_of_experience, federation_id)
Organizer (organizer_id*, organizer_name, office_address, contact_person)
Federation (federation_id*, federation_name, country, headquarters)
Player_Match (player_id*, match_id*, jersey_number, participation_status)
Referee_Match (referee_id*, match_id*, referee_role)
Payment (payment_id*, organizer_id, referee_id, match_id, payment_amount, payment_date)

*Asterisks denote primary keys; foreign keys reference corresponding parent entity primary keys.

内容的提问来源于stack exchange,提问作者Irravanan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 22:31:15