Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
geofmureithi authored Jun 13, 2022
1 parent 2b425aa commit f2cde99
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# ubu-block
UBU Blockchain

## Running
```sql
ubu-block query -q "Select
c.title as candidate,
SUM(votes) as votes,
ward_name as ward,
constituency_name as constituency,
county_name as county,
parties.title as party
from
results
INNER JOIN stations ON stations.id = results.station_id
INNER JOIN candidates c ON c.id = results.candidate_id
INNER JOIN wards on stations.ward_code = wards.ward_code
INNER JOIN parties ON parties.id = c.party_id
INNER JOIN constituencies ON wards.constituency_code = constituencies.constituency_code
INNER JOIN counties ON constituencies.county_code = counties.county_code
WHERE
position_type = 'Mp' and constituency = 'Juja'
GROUP BY
c.id ORDER by votes DESC ;"
```

You should get something like
```
+--------+--------------+----------+-----------+-------+-------+
| county | constituency | ward | candidate | party | votes |
+--------+--------------+----------+-----------+-------+-------+
| Kiambu | Juja | Kalimoni | Mwas | ODM | 738 |
+--------+--------------+----------+-----------+-------+-------+
| Kiambu | Juja | Kalimoni | Omosh | PNU | 228 |
+--------+--------------+----------+-----------+-------+-------+
```

0 comments on commit f2cde99

Please sign in to comment.