File size: 3,175 Bytes
d5e07bf
 
 
 
 
b4338b2
 
4344bfd
 
 
 
 
 
b4338b2
435cf85
b4338b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4344bfd
b4338b2
4344bfd
 
b4338b2
 
 
 
 
d5e07bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
pretty_name: SchemaPile
tags:
- SQL
- Schemas
dataset_info:
  features:
  - name: ID
    dtype: string
  - name: FILENAME
    dtype: string
  - name: URL
    dtype: string
  - name: LICENSE
    dtype: string
  - name: PERMISSIVE
    dtype: bool
  - name: TABLES
    list:
    - name: TABLE_NAME
      dtype: string
    - name: COLUMNS
      list:
      - name: NAME
        dtype: string
      - name: TYPE
        dtype: string
      - name: NULLABLE
        dtype: bool
      - name: UNIQUE
        dtype: bool
      - name: DEFAULT
        dtype: string
      - name: CHECKS
        sequence: string
      - name: IS_PRIMARY
        dtype: bool
      - name: IS_INDEX
        dtype: bool
      - name: VALUES
        sequence: string
    - name: PRIMARY_KEYS
      sequence: string
    - name: FOREIGN_KEYS
      list:
      - name: COLUMNS
        sequence: string
      - name: FOREIGN_TABLE
        dtype: string
      - name: REFERRED_COLUMNS
        sequence: string
      - name: ON_DELETE
        dtype: string
      - name: ON_UPDATE
        dtype: string
    - name: CHECKS
      sequence: string
    - name: INDEXES
      sequence: string
  splits:
  - name: full
    num_bytes: 142346554
    num_examples: 22989
  download_size: 39308883
  dataset_size: 142346554
configs:
- config_name: default
  data_files:
  - split: full
    path: data/full-*
---

# SchemaPile

### Usage

```python
from datasets import load_dataset
ds = load_dataset("trl-lab/schemapile", split="full")
print(f"Loaded dataset with {len(ds)} records.")
print(ds[0])
```

### Description

SchemaPile is a collection of database schemas extracted from various sources, normalized for consistency and ease of use in machine learning workflows. Each record contains metadata (`INFO`), licensing information, permissiveness, and a list of tables with detailed column specifications.

### Schema

- **INFO:**  
  - `ID`: Unique identifier (from filename prefix)  
  - `FILENAME`: Original filename  
  - Additional metadata fields

- **LICENSE:** License string (if available)  
- **PERMISSIVE:** Boolean indicating permissive license  
- **TABLES:** List of tables, each with:  
  - `TABLE_NAME`: Name of the table  
  - `COLUMNS`: List of columns, each with:
    - `NAME`, `TYPE`, `NULLABLE`, `UNIQUE`, `DEFAULT`, `CHECKS`, `IS_PRIMARY`, `IS_INDEX`, `VALUES`
  - `PRIMARY_KEYS`, `FOREIGN_KEYS`, `CHECKS`, `INDEXES`

### Citation

If you use SchemaPile in your research, please cite:

> ```bibtex
> @article{dohmen2024schemapile,
>   title={Schemapile: A large collection of relational database schemas},
>   author={D{"o}hmen, Till and Geacu, Radu and Hulsebos, Madelon and Schelter, Sebastian},
>   journal={Proceedings of the ACM on Management of Data},
>   volume={2},
>   number={3},
>   pages={1--25},
>   year={2024},
>   publisher={ACM New York, NY, USA}
> ```

**[Read the paper](https://schemapile.github.io/assets/SchemaPile.pdf)**

### Website

For more information, visit the [SchemaPile website](https://schemapile.github.io/).

### License

See individual record `LICENSE` fields for details. The `PERMISSIVE` flag indicates whether the schema is under a permissive license.