Updated 2022-06-09
    with dtcreate as (
    SELECT
    block_timestamp,
    block_id
    from algorand.block
    ),

    t2 as (select
    distinct ADDRESS as wallets
    from flipside_prod_db.algorand.account s left outer join dtcreate b on s.CREATED_AT=b.block_id
    where BALANCE>1
    and ACCOUNT_CLOSED='FALSE'
    and b.block_timestamp>='2022-05-01'),

    NFTs as(
    SELECT
    asset_id,asset_name
    from algorand.asset
    where total_supply = 1
    and decimals = 0
    and asset_deleted = 'False'
    )

    select
    'Bought NFT' as act,
    count(DISTINCT(asset_receiver)) as wallets
    from algorand.asset_transfer_transaction
    where asset_id in (select asset_id from NFTs)
    and asset_receiver in (select wallets from t2)
    union all
    select
    'Not Bought NFT' as act,
    count(DISTINCT(asset_receiver)) as wallets
    from algorand.asset_transfer_transaction
    where asset_id not in (select asset_id from NFTs)
    Run a query to Download Data