HiveSQL - Top 50 #HIVE Reputable Users - HIVE POWER & #HBD in Savings they #HODL...

Hey All,

Diving deep into HiveSQL and getting my hands dirty one more time. This time, I wanted to retrieve records related to Hive users, their Reputation, Hive Power, and the HBD they are holding. After some effort, I finally managed to fetch the data. Here’s a step-by-step summary of how I created the queries, along with their outputs.


First query triggered to get top 50 users and their Reputation i.e. highest reputation accounts appear first.

SELECT TOP 50 
    name, 
    reputation_ui
FROM Accounts
ORDER BY reputation_ui DESC;

First Query Output

UsernameReputation
hbd.funder99.81
buildawhale89.30
taskmaster445085.57
haejin85.53
oflyhigh85.21
tarazkp85.12
ocd84.74
chbartist83.60
poshtoken83.35
galenkp83.06
steemcleaners83.01
edicted82.92
acidyo82.89
gooddream82.88
burnpost82.82
cryptoandcoffee82.70
deanliu82.68
jrcornel81.96
kingscrown81.91
khaleelkazi81.85
josediccus81.75
zaku81.72
alokkumar12181.69
slobberchops81.53
tattoodjay81.46
papa-pepper81.44
erikah81.41
traf81.35
joythewanderer81.32
daveks81.25
papilloncharity81.25
trumpman81.24
revisesociology81.18
kkarenmp81.07
taskmaster4450le81.04
themarkymark81.02
nainaztengra80.99
adsactly80.88
bozz80.82
jongolson80.78
meesterboom80.76
derangedvisions80.75
riverflows80.73
daltono80.72
pinmapple80.62
travelgirl80.57
acesontop80.50
anggreklestari80.50
splinterlands80.47
priyanarc80.45

Second query triggered was to add the Hive Power to their names and for that I used the DynamicGlobalProperties table that contains the data returned by the get_dynamic_global_properties API. This API call is used to get the state of the Hive blockchain and its global parameters. It is updated every time a block is processed. As I wanted to know the HIVE POWER status of these accounts, I had to use this table DynamicGlobalProperties

WITH Globalinfo AS (  -- creating a temporary table
    SELECT 
        CAST(total_vesting_fund_hive AS FLOAT) / CAST(total_vesting_shares AS FLOAT) AS Hive_Per_VEST
    FROM DynamicGlobalProperties
)
SELECT TOP 50 
    A.name, 
    A.reputation_ui, 
    A.vesting_shares * G.Hive_Per_VEST AS Hive_Power
FROM Accounts A
CROSS JOIN Globalinfo G  -- attaching the Hive Power conversion factor to each user
ORDER BY A.reputation_ui DESC;  -- ensuring the highest reputation users appear first

Second Query Output

UsernameReputationHive Power
hbd.funder99.8122.80904503143511
buildawhale89.3063933.480950594254
taskmaster445085.57294402.85523154336
haejin85.537506.131346795173
oflyhigh85.21158739.17842221
tarazkp85.12206391.52021431507
ocd84.7414108.930751724036
chbartist83.606.2213732482631485
poshtoken83.3517103.58297225259
galenkp83.06253648.50816326542
steemcleaners83.0131201.186648666004
edicted82.92225380.76027778126
acidyo82.89153252.6913070298
gooddream82.8868543.73626491279
burnpost82.820.0
cryptoandcoffee82.70147921.37715045665
deanliu82.68122787.91947811435
jrcornel81.969.284129986643281
kingscrown81.915.090095234385113
khaleelkazi81.859942.439921362778
josediccus81.7583161.26949810807
zaku81.721891.0733531690853
alokkumar12181.6941330.90397081008
slobberchops81.53236818.2228582315
tattoodjay81.46130048.08224456086
papa-pepper81.441034.9461719312715
erikah81.41102248.02457043192
traf81.35151676.5954351633
joythewanderer81.320.0004950950586006
daveks81.25270371.70382043754
papilloncharity81.25131913.8686101904
trumpman81.2472915.84073488567
revisesociology81.18130391.99343459756
kkarenmp81.076492.898659816029
taskmaster4450le81.04121943.09867273988
themarkymark81.021399733.1471457137
nainaztengra80.9948789.639133172444
adsactly80.880.5121181186786122
bozz80.8290060.93681083719
jongolson80.7820071.867594570977
meesterboom80.76128991.05941356548
derangedvisions80.751239.6827234643556
riverflows80.7324699.59793434295
daltono80.7216685.11913732083
pinmapple80.62356.41296243656444
travelgirl80.571155.5647758071532
acesontop80.501385.6173406565365
anggreklestari80.502368.236343037443
splinterlands80.472550.242108615956
priyanarc80.458785.971983859732

Now I wanted to check if these accounts are holding any HBD [Hive Backed Dollar] in their savings account or not. Here is the final query that was triggerd to get me the results of - "Top 50 #HIVE Reputable Users - HIVE POWER & #HBD in Savings they #HODL... "

Final Query - Top 50 users, Reputation, Hive POWER and HBD in Savings

WITH Globalinfo AS (
    SELECT 
        CAST(total_vesting_fund_hive AS FLOAT) / CAST(total_vesting_shares AS FLOAT) AS Hive_Per_VEST
    FROM DynamicGlobalProperties
)
SELECT TOP 50 
    A.name, 
    A.reputation_ui, 
    A.vesting_shares * G.Hive_Per_VEST AS Hive_Power, 
    A.savings_hbd_balance AS Savings_HBD -- retrieving the HBD in savings
FROM Accounts A
CROSS JOIN Globalinfo G
ORDER BY A.reputation_ui DESC;

Final Query Output

UsernameReputationHive PowerHBD in Savings
hbd.funder99.8122.8090643878817830.000
buildawhale89.3063933.535206483220.000
taskmaster445085.57294403.1050707260.000
haejin85.537506.1377167256520.000
oflyhigh85.21158743.32689386313897.787
tarazkp85.12206391.69536441230.000
ocd84.7414108.9427249901380.985
chbartist83.606.221378527908980.000
poshtoken83.3517103.5974868712950.000
galenkp83.06253648.72341707441049.309
steemcleaners83.0131201.2131269383170.000
edicted82.92225380.95154272290.000
acidyo82.89153252.821361906830.000
gooddream82.8868543.79443320417957.051
burnpost82.820.00.000
cryptoandcoffee82.70147921.5026810195.416
deanliu82.68122788.0236796629916087.267
jrcornel81.969.2841378654372750.000
kingscrown81.915.0900995539941460.000
khaleelkazi81.859942.4483588185271.437
josediccus81.7583165.19820933556180.050
zaku81.721891.07495799122780.009
alokkumar12181.6941330.939045467420.002
slobberchops81.53236818.42382935042284.744
tattoodjay81.46130048.19260730361661.233
papa-pepper81.441034.94705021794930.000
erikah81.41102248.111341203450.000
traf81.35151676.724152517620.000
joythewanderer81.320.00049509547875330.000
daveks81.25270371.933266057051789.208
papilloncharity81.25131913.980556295984274.468
trumpman81.2472915.90261347732729.396
revisesociology81.18130392.104089193766074.975
kkarenmp81.076492.90416988655132.909
taskmaster4450le81.04121943.20215734814236.641
themarkymark81.021399737.52500344420.000
nainaztengra80.9948789.680537538420.000
adsactly80.880.51211855327756360.026
bozz80.8290061.01323927688250.711
jongolson80.7820071.8846281659460.000
meesterboom80.76128991.168879286623000.657
derangedvisions80.751239.68377549667410.001
riverflows80.7324699.618895170097385.792
daltono80.7216685.133296818450.032
pinmapple80.62356.41326489940280.000
travelgirl80.571155.5657564544329628.538
acesontop80.501385.61851653339250.000
anggreklestari80.502368.2383527945560.000
splinterlands80.472550.24427282867550.000
priyanarc80.458785.9794399017521230.740

So here we have the final query results; querying HiveSQL to get Top 50 users having the highest reputation their HIVE POWER and HBD in the Savings account. All the queries are tried and tested they are working absolutely fine all that you will require is to connect to the HiveSQL database and then trigger the queries its that simple.

HiveSQL - Top 50 #HIVE Reputable Users - HIVE POWER & #HBD in Savings they #HODL...

#hivesql #DBeaver #learning #hivestatistics #data #datamining #hiveaccount #liquidhive #DynamicGlobalProperties

image source:: hive.io, hive x

Best Regards
Paras

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
17 Comments