with prep as (SELECT *, LAG(confirmed_cases, 1)OVER (PARTITION BY state_name ORDER BY date ASC) AS prev_dayFROM `bigquery-public-data.covid19_nyt.us_states`where upper(state_name) = 'TEXAS'and date >= '2021-03-01'order by date asc)
select date, confirmed_cases - prev_day as new_cases --since…
Let's keep track of all my 40 cats:
insert into MyPets values (1, "Fluffy", 8, "Brown", "")Change the age: update MyPets set petAge = 9 where petID = 1
insert into subList (values(2, "Timmy"), (3, "Fishy"), (4,"Catty"), (5,"Labrador"))