You are viewing a single comment's thread from:

RE: LeoThread 2025-02-10 00:58

in LeoFinancelast month

Part 7/8:

Candidates may encounter practical problems, such as computing points for a sports team based on match results. This may involve SQL queries using CASE statements and aggregations.

Example Query:


SELECT team_id,

SUM(CASE WHEN host_goals > guest_goals THEN 3

WHEN host_goals = guest_goals THEN 1

ELSE 0 END) AS points

FROM Matches

GROUP BY team_id;

Conclusion