File size: 3,258 Bytes
bf390d7
 
 
 
 
 
 
 
 
 
ce8e44a
 
bf390d7
 
 
 
 
 
 
 
 
 
 
 
 
ce8e44a
bf390d7
 
 
 
ce8e44a
b2a963c
ce8e44a
 
 
b2a963c
ce8e44a
b2a963c
ce8e44a
 
 
b2a963c
ce8e44a
b2a963c
ce8e44a
 
 
 
 
 
b2a963c
ce8e44a
 
b2a963c
ce8e44a
b2a963c
 
 
 
f8e31b4
b2a963c
 
ce8e44a
b2a963c
ce8e44a
 
 
 
 
 
b2a963c
ce8e44a
b2a963c
ce8e44a
 
 
b2a963c
ce8e44a
b2a963c
ce8e44a
 
 
 
 
 
b2a963c
 
 
ce8e44a
 
 
 
 
 
b2a963c
ce8e44a
b2a963c
ce8e44a
b2a963c
 
 
 
ce8e44a
 
 
 
 
 
f8e31b4
b2a963c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
license: cc0-1.0
task_categories:
- text-classification
- text-generation
- tabular-classification
- tabular-regression
language:
- en
tags:
- synthetic
- template-generated
- database
- sql
- query-optimization
- performance
- nosql
- mongodb
- redis
- cassandra
- elasticsearch
- mysql
- postgresql
- oracle
- sql-server
pretty_name: Database Query Logs (synthetic)
size_categories:
- 1K<n<10K
---

# Database Query Logs (synthetic)

3,995 database query-log entries spanning 10 engines - MySQL, PostgreSQL, MongoDB, SQL
Server, Oracle, MariaDB, SQLite, Cassandra, Redis, and Elasticsearch - with query text,
type, complexity, execution timing, and row-count metadata.

## These queries are synthetic

The queries were **programmatically generated**, not captured from production systems.
They were produced by templating a set of query shapes across industry-flavored schema
names.

The generation shows through:

- 3,195 training rows contain **2,243 distinct queries (70.2%)**; one Elasticsearch query
  body appears 35 times.
- The same query recurs with only the schema name swapped - `DELETE FROM telecom_logs`
  and `DELETE FROM construction_logs` are otherwise byte-identical.
- Some generated SQL is **not valid**. Schema names containing hyphens appear unquoted
  (`DELETE FROM E-COMMERCE.AUDIT_LOGS`), which will not parse.

A previous version of this card described the contents as "real-world and synthetic".
There is no verified production-captured subset; treat the whole dataset as synthetic.

## Loading

```python
from datasets import load_dataset

ds = load_dataset("robworks-software/database-query-logs-synthetic")
```

## Splits

| Split | Rows |
|-------|------|
| train | 3,195 |
| validation | 396 |
| test | 404 |
| **total** | **3,995** |

## Appropriate use

- Parser and tokenizer testing across dialects (bearing in mind some queries are invalid).
- Query-type and complexity classification.
- Teaching examples of dialect syntax differences.

## Inappropriate use

- **Performance modeling or optimizer research.** `execution_time_ms`, `rows_examined`,
  and `rows_returned` are generated values. They were not measured on any real system and
  have no relationship to what these queries would actually cost. Do not train a cost
  model on them.
- **Workload characterization.** The distribution reflects the generator's template mix,
  not any real application's query pattern.

## Limitations

- **Synthetic throughout** - see above.
- **Some queries are syntactically invalid.**
- **70.2% distinct queries**, with heavy near-duplication beyond exact repeats.
- **Timing and row-count fields are fabricated.**
- **Schema names are industry labels** (`TELECOMMUNICATIONS`, `EDUCATION`, `LOGISTICS`)
  applied cosmetically; they do not reflect real domain schemas.

## License

**CC0-1.0.** Entirely generated content, dedicated to the public domain.

## Citation

```bibtex
@dataset{database_query_logs_synthetic,
  title  = {Database Query Logs (synthetic)},
  author = {Robworks Software},
  year   = {2025},
  publisher = {Hugging Face},
  note   = {Programmatically generated queries; timing metadata is fabricated},
  url    = {https://huggingface.co/datasets/robworks-software/database-query-logs-synthetic}
}
```