create account

Connecting to the SteemSQL database via R by verodato

View this thread on: hive.blogpeakd.comecency.com
· @verodato ·
$263.00
Connecting to the SteemSQL database via R
![](https://cdn.steemitimages.com/DQmZVSnnRjPEkgZzQVtoEFokRmUEQBYTDdvxfNbHuvvDYz3/image.png)

As discussed in the previous post (https://busy.org/@verodato/steem-blockchain-the-forest-and-the-trees), we’re going to use the SteemSQL service to get the Steem blockchain data. The connection to the database will be made using the R software (https://www.r-project.org/). It’s a widely used open source statics and programming language and environment. Remember to download the free version of the RStudio editor if it is your first time trying R (https://www.rstudio.com/). You’ll need to install the RJDBC package too. 

The R code to connect to the SQL server is the following (“user” and “password” are supplied by the SteemSQL service upon payment):

````
    require(RJDBC)
    drv <- JDBC("net.sourceforge.jtds.jdbc.Driver",
             "/home/user/Downloads/jtds-1.2.8-dist/jtds-1.2.8.jar") 
    conn <- dbConnect(drv, "jdbc:jtds:sqlserver://vip.steemsql.com;DatabaseName=DBSteem", domain="windows domain", user="username", password="userpassword")
````

Once connected, we can make a query, for example, to check what is the total number of accounts in the Steem blockchain:

````
    sqltxt <- "SELECT COUNT(ID) FROM Accounts"
    dbGetQuery(conn, sqltxt)
````

That’s it! Quite easy (if you had no trouble installing stuff). In the next post we’ll see how to get Steem delegation data and how to calculate time series from it. If you have any doubt about installing R, R packages, RStudio, MS drive, put it in the comments below and I’ll try to help you.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 228 others
properties (23)
authorverodato
permlinkconnecting-to-the-steemsql-database-via-r
categorycryptocurrency
json_metadata{"tags":["cryptocurrency","blockchain","steem","finance","investing"],"image":["https://cdn.steemitimages.com/DQmZVSnnRjPEkgZzQVtoEFokRmUEQBYTDdvxfNbHuvvDYz3/image.png"],"links":["https://busy.org/@verodato/steem-blockchain-the-forest-and-the-trees","https://www.r-project.org/","https://www.rstudio.com/"],"app":"steemit/0.1","format":"markdown"}
created2018-06-09 17:13:12
last_update2018-06-09 17:13:12
depth0
children10
last_payout2018-06-16 17:13:12
cashout_time1969-12-31 23:59:59
total_payout_value205.938 HBD
curator_payout_value57.058 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,563
author_reputation18,143,558,301,797
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,021,092
net_rshares98,534,056,389,150
author_curate_reward""
vote details (292)
@a-0-0 ·
Go here https://steemit.com/@a-a-a to get your post resteemed to over 72,000 followers.
properties (22)
authora-0-0
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180609t171338538z
categorycryptocurrency
json_metadata{"tags":["cryptocurrency"],"links":["https://steemit.com/@a-a-a"],"app":"steemit/0.1"}
created2018-06-09 17:13:39
last_update2018-06-09 17:13:39
depth1
children0
last_payout2018-06-16 17:13:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length87
author_reputation-4,863,186,238,920
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,021,147
net_rshares0
@alelerdici ·
Hello, world!
Today i will write about MassCoin - software for checking the threshold value of any cryptocurrency with comfort.
masscoinapp.com - start trade with pleasure.
👎  ,
properties (23)
authoralelerdici
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180610t185454998z
categorycryptocurrency
json_metadata{"tags":["cryptocurrency"],"app":"steemit/0.1"}
created2018-06-10 18:55:12
last_update2018-06-10 18:55:12
depth1
children1
last_payout2018-06-17 18:55:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length172
author_reputation-790,378,343,619
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,181,163
net_rshares-74,336,046,546
author_curate_reward""
vote details (2)
@abusereports ·
$1.12
@alelerdici you're on the @abusereports naughty list!<br><br>**Bad Steemian! Bad!**
👍  ,
properties (23)
authorabusereports
permlinkabusereports-re-alelerdicire-verodato-connecting-to-the-steemsql-database-via-r-20180610t185454998z
categorycryptocurrency
json_metadata""
created2018-06-10 18:55:21
last_update2018-06-10 18:55:21
depth2
children0
last_payout2018-06-17 18:55:21
cashout_time1969-12-31 23:59:59
total_payout_value0.845 HBD
curator_payout_value0.279 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length83
author_reputation199,407,425,243,286
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,181,181
net_rshares429,006,586,433
author_curate_reward""
vote details (2)
@anealireki ·
Want to start trading with comfort?
https://masscoinapp.com/ - the best thing for it.
Read the description on the main page!
properties (22)
authoranealireki
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180609t153945103z
categorycryptocurrency
json_metadata{"tags":["cryptocurrency"],"links":["https://masscoinapp.com/"],"app":"steemit/0.1"}
created2018-06-09 19:39:48
last_update2018-06-09 19:39:48
depth1
children0
last_payout2018-06-16 19:39:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length124
author_reputation-789,520,197,712
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,038,760
net_rshares0
@blessing786 ·
Wonderful and useful information you provided. THANKS FOR THIS
properties (22)
authorblessing786
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180609t171831696z
categorycryptocurrency
json_metadata{"tags":["cryptocurrency"],"app":"steemit/0.1"}
created2018-06-09 17:18:33
last_update2018-06-09 17:18:33
depth1
children0
last_payout2018-06-16 17:18:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length62
author_reputation1,859,967,886,450
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,021,776
net_rshares0
@booster ·
<p>This post has received a 39.98 % upvote from @booster thanks to: @verodato.</p>
properties (22)
authorbooster
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180612t010718171z
categorycryptocurrency
json_metadata{"tags":["cryptocurrency"],"app":"drotto/0.0.5pre3"}
created2018-06-12 01:07:18
last_update2018-06-12 01:07:18
depth1
children0
last_payout2018-06-19 01:07:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length83
author_reputation68,767,115,776,562
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,375,208
net_rshares0
@habiba234 ·
This is a nice inquiry!!!!!
950,000 user are on steemit,,
Active user little,,
i waited for your next post..Thanks a lot,,
@follow you as a new,,
👍  
properties (23)
authorhabiba234
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180610t183220234z
categorycryptocurrency
json_metadata{"tags":["cryptocurrency"],"users":["follow"],"app":"steemit/0.1"}
created2018-06-10 18:32:24
last_update2018-06-10 18:32:24
depth1
children0
last_payout2018-06-17 18:32:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length145
author_reputation61,884,223,375
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,178,382
net_rshares496,823,683
author_curate_reward""
vote details (1)
@postpromoter ·
re-verodato-connecting-to-the-steemsql-database-via-r-20180611t163403892z
You got a 4.07% upvote from @postpromoter courtesy of @verodato!

Want to promote your posts too? Check out the [Steem Bot Tracker website](https://steembottracker.com) for more info. If you would like to support the development of @postpromoter and the bot tracker please [vote for @yabapmatt for witness!](https://v2.steemconnect.com/sign/account-witness-vote?witness=yabapmatt&approve=1)
properties (22)
authorpostpromoter
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180611t163403892z
categorycryptocurrency
json_metadata{"app":"postpromoter/2.0.0"}
created2018-06-11 16:34:03
last_update2018-06-11 16:34:03
depth1
children0
last_payout2018-06-18 16:34:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length391
author_reputation12,722,616,650,811
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,320,756
net_rshares0
@upme ·
re-verodato-connecting-to-the-steemsql-database-via-r-20180611t203008738z
You got a 30.55% upvote from @upme thanks to @verodato! Send at least 3 SBD or 3 STEEM to get upvote for next round. Delegate STEEM POWER and start earning 100% daily payouts ( no commission ).
properties (22)
authorupme
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180611t203008738z
categorycryptocurrency
json_metadata{"app":"postpromoter/2.0.0"}
created2018-06-11 20:30:18
last_update2018-06-11 20:30:18
depth1
children0
last_payout2018-06-18 20:30:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length194
author_reputation584,696,346,293
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,348,388
net_rshares0
@upmewhale ·
re-verodato-connecting-to-the-steemsql-database-via-r-20180609t172152754z
You got a 5.92% upvote from @upmewhale courtesy of @verodato!

Earn 100% earning payout by delegating SP to @upmewhale. Visit http://www.upmewhale.com for details!
properties (22)
authorupmewhale
permlinkre-verodato-connecting-to-the-steemsql-database-via-r-20180609t172152754z
categorycryptocurrency
json_metadata{"app":"postpromoter/2.0.0"}
created2018-06-09 17:21:54
last_update2018-06-09 17:21:54
depth1
children0
last_payout2018-06-16 17:21:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length164
author_reputation28,704,887,249,463
root_title"Connecting to the SteemSQL database via R"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id60,022,183
net_rshares0