Query editor
/* NULL valuesRead the accompanying article:Uncomment each block one by one and run the query.*/-- -- 01. count the number of valid (non-NULL) values in a column-- select-- count(*) as num_of_rows,-- count(token_sold_symbol) as num_of_non_missing_sold_symbols,-- count(token_sold_amount) as num_of_non_missing_sold_amounts,-- count(token_bought_symbol) as num_of_non_missing_bought_symbols,-- count(token_bought_amount) as num_of_non_missing_bought_amounts-- from uniswap.trades-- -- 02. group by and count-- select-- token_sold_symbol,-- count(*) as num_of_rows,-- count(token_bought_symbol) as num_of_non_missing_bought_symbols,-- sum(token_bought_amount) as total_bought_amount,-- avg(token_bought_amount) as avg_bought_amount,-- min(token_bought_amount) as min_bought_amount,-- max(token_bought_amount) as max_bought_amount-- from uniswap.trades-- where token_sold_symbol in ('ARB', 'STG')-- group by 1-- -- 03. group by and count distinctselecttoken_sold_symbol,count(distinct token_bought_symbol) as num_of_unique_bought_symbolsfrom uniswap.tradeswhere token_sold_symbol in ('ARB', 'STG')group by 1