---
# System prepended metadata

title: football

---

# football

## Players table
* id bigserial
* first_name varchar
* last_name varchar
* birthday date

## Teams table
* id bigserial
* name varchar
* name_short varchar

## Games table
```sql
CREATE TABLE games (
    id BIGSERIAL NOT NULL PRIMARY KEY,
    date DATETIME,
    type VARCHAR,
    stadium_id INTEGER REFERENCES stadiums(id),
    home_team_id INTEGER REFERENCES teams(id),
    other_team_id INTEGER REFERENCES teams(id),
    winner_team_id INTEGER REFERENCES teams(id)
);
```

## Stadiums table
```sql
CREATE TABLE stadiums (
    id BIGSERIAL NOT NULL PRIMARY KEY,
    name VARCHAR,
    type VARCHAR,
    location VARCHAR,
    -- location_gis whatever the gis type is,
    --  * Take lat, long, elevation from csv?
    address VARCHAR,
    capacity INTEGER
);
```

## Querying
```sql

```