walemathsSales Value
    Updated 2024-06-15
    WITH total_minting AS (
    SELECT
    COUNT(*) AS total_minted_nfts
    FROM
    aptos.nft.ez_nft_mints
    ),
    total_sales AS (
    SELECT
    COUNT(*) AS total_sold_nfts,
    SUM(total_price) AS total_sales_value -- Replace total_price with the correct column name if necessary
    FROM
    aptos.nft.ez_nft_sales
    )
    SELECT
    tm.total_minted_nfts,
    COALESCE(ts.total_sold_nfts, 0) AS total_sold_nfts,
    COALESCE(ts.total_sales_value, 0) AS total_sales_value,
    (COALESCE(ts.total_sold_nfts, 0) * 100.0 / tm.total_minted_nfts) AS conversion_rate
    FROM
    total_minting tm
    LEFT JOIN
    total_sales ts;

    QueryRunArchived: QueryRun has been archived