---
title: "Analyzing Wimbledon tennis data with chDB"
description: "Tennis scoring logic can be encoded as ClickHouse SQL user-defined functions that compute how many points each player needs to win a match, then applied to Wimbledon point-by-point data to show Alcaraz was never close to losing his five-set first-round match against Fognini."
url: "https://swe.quest/articles/analyzing-wimbledon-tennis-data-with-chdb-6a28f96019de015f"
canonical: "https://clickhouse.com/blog/analyzing-wimbledon-2025-chdb"
source: "ClickHouse"
published: "2025-07-03"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["analytics","sql","testing","python"]
---

# Analyzing Wimbledon tennis data with chDB

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-07-03, 8 min read, How-to. Original: [https://clickhouse.com/blog/analyzing-wimbledon-2025-chdb](https://clickhouse.com/blog/analyzing-wimbledon-2025-chdb)

## Summary

Tennis scoring logic can be encoded as ClickHouse SQL user-defined functions that compute how many points each player needs to win a match, then applied to Wimbledon point-by-point data to show Alcaraz was never close to losing his five-set first-round match against Fognini. The workflow uses clickhouse-local with a persistent path for development, and chDB opens the same database in-process from Python so pytest can run parameterized tests against the UDFs, catching bugs across scoring scenarios. Matches and points are stored in MergeTree tables with tuple columns for per-player state, and a Streamlit and Plotly app visualizes proximity to victory point by point.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- Python pytest ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

ClickHouse, chDB, clickhouse-local, pytest, Streamlit, Plotly, uv

## Related posts

- [Replacing the HDB: ClickHouse for historical ticker data](https://swe.quest/articles/replacing-the-hdb-clickhouse-for-historical-ticker-data-cd7a8f768807547b.md): ClickHouse · 2026-07-15 · Medium · 19 min read · Analytics & OLAP, SQL, Databases, Performance engineering
  ClickHouse can serve as the historical tier (HDB) of a market data system, a low-risk place to adopt a new database.
- [Solving the "Impossible" in ClickHouse: Advent of Code 2025](https://swe.quest/articles/solving-the-impossible-in-clickhouse-advent-of-code-2025-a7dba91c6e7476ad.md): ClickHouse · 2025-12-31 · Medium · 42 min read · SQL, Analytics & OLAP, Algorithms
  All 12 Advent of Code 2025 puzzles are solved in pure ClickHouse SQL, each as a single query that parses the raw input and computes both parts with no UDFs, temporary tables or preprocessing.
- [Using ClickHouse UDFs to integrate with OpenAI models](https://swe.quest/articles/using-clickhouse-udfs-to-integrate-with-openai-models-798f9ca64f94924a.md): ClickHouse · 2023-09-14 · Medium · 17 min read · Analytics & OLAP, LLMs, SQL, Python
  ClickHouse executable user-defined functions can call the OpenAI chat completions API from SQL, adding sentiment labels or extracted entities to rows at insert or query time.
- [Trade secrets: How Coinhall uses ClickHouse to power its blockchain data platform](https://swe.quest/articles/trade-secrets-how-coinhall-uses-clickhouse-to-power-its-blockchain-data-platform-a19f7fb99396fe78.md): ClickHouse · 2024-08-14 · Easy · 5 min read · Analytics & OLAP, Databases, Performance engineering, Cost optimization
  Coinhall, an omnichain trading terminal aggregating swap data from 23 blockchains, moved from BigQuery (about 2-second queries, thousands of dollars per month) to QuestDB and then to self-hosted ClickHouse.
- [ClickHouse Newsletter August 2022: Airlines are maybe not that bad](https://swe.quest/articles/clickhouse-newsletter-august-2022-airlines-are-maybe-not-that-bad-1b3d45affdf6ad87.md): ClickHouse · 2022-08-11 · Medium · 7 min read · Analytics & OLAP, SQL, Databases
  ClickHouse's August 2022 newsletter introduces ClickBench, a benchmark for analytical databases built on a real-world web analytics dataset, and summarizes the 22.7 release: positional arguments on by default, deprecation of the Ordinary engine, new direct and full\_sorting\_merge join algorithms, a MongoDB table function, additional table and result filters, and HTTP support in clickhouse-go.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
