Query para saber el número de cuentas en Hive y holders

in #spanish3 months ago

HIVE.png


¡Hola, Hivers!

He estado ocupado resolviendo algunas cosas relacionadas con Hive que me pidió @arlettemsalase para unas tareas que tiene, y empecé con lo más común que es ver la cantidad de cuentas en Hive y holders que tengan balance superior a 0.

Así que procedí a hacer la Query para saber cuántas cuentas tienen balance superior a 0, y a continuación muestro cómo hacerlo en SQL y el resultado está abajo.

Todo esto lo hago con el servicio de HiveSQL.


SELECT 
    (SELECT COUNT(*) 
     FROM Accounts (NOLOCK) 
     WHERE vesting_shares > 0) AS Cuentas_con_mas_de_0_HP,
     
    (SELECT COUNT(*) 
     FROM Accounts (NOLOCK) 
     WHERE balance > 0) AS Cuentas_con_mas_de_0_HIVE,

    (SELECT COUNT(*) 
     FROM Accounts (NOLOCK) 
     WHERE hbd_balance > 0) AS Cuentas_con_mas_de_0_HBD,

    (SELECT COUNT(*) 
     FROM Accounts (NOLOCK) 
     WHERE savings_hbd_balance > 0) AS Cuentas_con_mas_de_0_Savings_HBD,

    (SELECT COUNT(DISTINCT name)
     FROM (
         SELECT name FROM Accounts (NOLOCK) WHERE vesting_shares > 0
         UNION
         SELECT name FROM Accounts (NOLOCK) WHERE balance > 0
         UNION
         SELECT name FROM Accounts (NOLOCK) WHERE hbd_balance > 0
         UNION
         SELECT name FROM Accounts (NOLOCK) WHERE savings_hbd_balance > 0
     ) AS unique_accounts) AS Cuentas_uniques_hp_hive_hbd_savings_hbd;


Resultado:

Cuentas con HPCuentas con HiveCuentas con HBDCuentas con HBD savingCuentas total Holders
1180995575749274143172731474066


Vamos por una Query más, vamos a hacer uno donde veamos cuantas cuentas tienen un saldo superior a 100 Hive en HP, 10 HIVE o 10 HP

SELECT 
    (SELECT COUNT(*) 
     FROM Accounts (NOLOCK) 
     WHERE vesting_shares * 0.0005827011 > 10) AS Cuentas_con_mas_de_10_HP,
     
    (SELECT COUNT(*) 
     FROM Accounts (NOLOCK) 
     WHERE balance > 10) AS Cuentas_con_mas_de_10_HIVE,

    (SELECT COUNT(*) 
     FROM Accounts (NOLOCK) 
     WHERE hbd_balance > 10) AS Cuentas_con_mas_de_10_HBD,

    (SELECT COUNT(*) 
     FROM Accounts (NOLOCK) 
     WHERE savings_hbd_balance > 10) AS Cuentas_con_mas_de_10_Savings_HBD,

    (SELECT COUNT(DISTINCT name)
     FROM (
         SELECT name FROM Accounts (NOLOCK) WHERE vesting_shares * 0.0005827011 > 10
         UNION
         SELECT name FROM Accounts (NOLOCK) WHERE balance > 10
         UNION
         SELECT name FROM Accounts (NOLOCK) WHERE hbd_balance > 10
         UNION
         SELECT name FROM Accounts (NOLOCK) WHERE savings_hbd_balance > 10
     ) AS unique_accounts) AS Cuentas_uniques_hp_hive_hbd_savings_hbd;



Cuentas con HPCuentas con HiveCuentas con HBDCuentas con HBD savingCuentas total Holders
15043236309156294101172749


El total de cuentas de Hive actual es de:

2510266 cuentas creadas


Estos resultados pueden tener un margen de error, así que tienes un comentario al respecto, puedes hacerlo sin problemas.

Igualmente, si quisieras conocer un dato de Hive, lo puedes dejar en los comentarios.

Saludos.

Sort:  

Que genial, me encanta este tipo de contenido.

Ameisin

Excelente información.!

Wow!!! This is super cool and informative. Thank you so much for sharing friend.

Congratulations @enrique89! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You got more than 3750 replies.
Your next target is to reach 4000 replies.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Somos más de dos millones de hivers de los cuales más del 60% tiene Hive líquido o en stacking, me encanta.

Congratulations @enrique89! You received a personal badge!

Happy Hive Birthday! You are on the Hive blockchain for 7 years!

You can view your badges on your board and compare yourself to others in the Ranking

Check out our last posts:

Hive Power Up Day - August 1st 2024