Skip to content

Instantly share code, notes, and snippets.

@YazzyYaz
Last active February 22, 2019 03:53
Show Gist options
  • Save YazzyYaz/28f45c94a282e3748310fd8ca3608fda to your computer and use it in GitHub Desktop.
Save YazzyYaz/28f45c94a282e3748310fd8ca3608fda to your computer and use it in GitHub Desktop.
Daily Mined Blocks Ethereum Classic
WITH greater_than_million AS (
SELECT TIMESTAMP_TRUNC(timestamp, DAY) AS block_day,
COUNT(*) AS gtm_blocks_mined
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
WHERE gas_used > 1000000
GROUP BY block_day
),
total_blocks AS (
SELECT TIMESTAMP_TRUNC(timestamp, DAY) AS day,
COUNT(*) AS total_blocks_mined
FROM `bigquery-public-data.crypto_ethereum_classic.blocks`
GROUP BY day
),
combined_book AS (
SELECT *
FROM total_blocks tot
LEFT JOIN greater_than_million gtm ON tot.day = gtm.block_day
)
SELECT gtm_blocks_mined,
total_blocks_mined,
day
FROM combined_book
ORDER BY day ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment