2021. már 19.

COVID-19 public dataset focusing on: Texas

írta: dataanalyticsdemo
COVID-19 public dataset focusing on: Texas

Where is Texas in the number of states compared to the other states?
Pretty high.

SELECT
state_name, confirmed_cases, deaths, round(deaths/confirmed_cases,4) as death_rate
FROM `bigquery-public-data.covid19_nyt.us_states`
where date in (select max(date) from `bigquery-public-data.covid19_nyt.us_states` )
order by 2 desc

March 2021, repopening
How are the new cases doing in March?

with prep as (
SELECT *
, LAG(confirmed_cases, 1)
OVER (PARTITION BY state_name ORDER BY date ASC) AS prev_day
FROM `bigquery-public-data.covid19_nyt.us_states`
where upper(state_name) = 'TEXAS'
and date >= '2021-03-01'
order by date asc
)

select *
, confirmed_cases - prev_day as new_cases --since the prev.day
from prep
order by date asc

As you can see, it changes day by day, some days are better, some days are worse in the daily new cases. However, the expected spike on the new cases due to the reopening is yet to be seen.

Szólj hozzá

public SQL COVID-19 Bigquery Partition by