Giter Club home page Giter Club logo

edge-sql's Introduction

Analyzing vaccination data on the Edge using SQL (on the edge)

Deploy

This repository is a fork from the original edge-sql project here https://github.com/lspgn/edge-sql. All the hard work was done there and I cannot take credit for it, it's a great idea.

The difference in this repository is the data set. Since I'm already scraping the data from the German Roland-Koch-Institute for the daily vaccination numbers, I felt this is an awesome approach to provide even easier access to the data in my beloved SQL.

Thanks to Cloudflare for providing this amazing tech. It uses a Cloudflare Worker embedding SQLite with WASM.

Data

The data is in the vaccinations table and loaded with the following columns:

  • date - when the event was recorded
  • state - in which state
  • vacc_first - amount of first vaccine shots this day
  • vacc_second - amount of second vaccine shots this day
  • ewz - population in the state

Sample Questions

The following is a list of sample questions that you can run on the dataset:

Number of rows in the dataset:

curl -XPOST --data \
"select count(*) from vaccinations;" \
https://sql.grundprinzip.workers.dev/query
count(*)
352

Number of shots given in the last 7 days:

curl -XPOST --data \
"select
  sum(vacc_first + vacc_second)
from vaccinations
where
  date > date('now','-7 day')
;" \
https://sql.grundprinzip.workers.dev/query
539957

Calculating Herd immunity based on the data:

curl -XPOST --data \
"with twoshots as (select
  -- We need two shots to be ready
  sum(vacc_second) as total
from vaccinations)

select round((select total from twoshots) / cast(sum(ewz) as float) * 100, 4)
from vaccinations
where date = '2021-01-01'
;" \
https://sql.grundprinzip.workers.dev/query
0.1385

edge-sql's People

Contributors

grundprinzip avatar lspgn avatar

Watchers

 avatar  avatar

Forkers

definiteiymaybe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.