SteemSQL, it opens the door to data

in #steemsql6 years ago


Source
Almost every application on the Steem blockchain uses data from the Blockchain database. And there are a lot of way's to get that data. I ran into SteemSQL (I saw it mentioned in the Curie discord channel).

@steemsql is a actual copy of the Steem database in Microsoft SQL Server. Microsoft SQL Server is the RDBMS (Relational Database Management System) of Microsoft and is a widely used Database product. There is a lot to say and think of Microsoft but a strong point of their products is that almost every product can work with the other, for instance the Office Suite, all products (Word, Excel, Powerpoint, Outlook) can work or export to eachother. So for Microsoft SQL you can easy implort data from databases into word or excel, so this creates an 'easy' way of fetching data from the steemdatabase.

Line-Break.png

So what is SQL?


SQL stands for Structured Query Language and is a kind of language with which you can 'talk' to a database. Many database vendors have a slightly different approach of the language but mostly it's tsql. (trnasact SQL).

If you want to know some more about SQL you can have a look at w3schools.

But in basic you give the SQL server a command like this:

Select author
from comments
where author = 'verhp11'

You litteraly say to the database: Read the table with comments, select all the authors who's name is verhp11.

The result:
verhp11
verhp11
verhp11
verhp11
verhp11
verhp11
verhp11
verhp11
verhp11
verhp11
verhp11

As you can see I get 11 returns of the same authorname, why is that? That is because I didn't tell the database to look for a unique name so to give me one record. This result (11 times) is because my name was registred with 11 comments in the database, so the database will return them all.

It goes to far to explain how you can achieve all the requirements you want to implement to only show that information that you want, but this is in a nutshell how SQL works. You ask the database for information with certain parameters, and the database returns you the information.

Line-Break.png

What can you get from the Steem database?


Although I just started to have a look around, you can get almost all the information about everything that's happening on the Steem blockchain.

  • Information about posts
  • Information about payouts
  • Information about resteems
  • Information about comments
  • Information about flags
  • and so on, and so on...

For instance


Select name, votes
from witnesses
order by votes desc

will show a list of all witnesses ordered in the ammount of votes they got.

select top 20 author, title, body
from dbo.TxComments
where author like '%verhp11%'

Gives the top 20 comments which I gave. The data that's shown are the author, title of the post (if applicable) and the body of the comment.

Line-Break.png

Steemsql isn't free to use, you can either get access for a day (which cost 1 SBD) or you can get access for a month (which cost 10 SBD).. So if you want to show statistics or want to gather more information then is available by default you can consider using @steemsql , it's easy to use without a lot of programknowledge.

Tools you can use for using the database are (for exmaple

  • Microsoft SQL management Studio (free download)
  • Linqpad (free download)
  • Excel
  • Word
  • Access

Have a great sunny day


Alt text
Proud member of SMG


I fully support @s3rg3 and @exyle, who are witness with their developer group @blockbrothers for the Steem blockchain. If you want to support them, they would appreciate your vote here.


They are the creators of Steemify, THE notification app for your Steemit account for IOS.


steem-banner.jpg

Sort:  

This is really cool. I haven't done any SQL programming since I was in college, but it was a very interesting class. It is super powerful and I can see the benefit of having all of that data from the blockchain available to run queries on.

I'm still thinking of a cool way to use it :)

Hi may I ask is this service still alive? I cannot access it.

Ru
Приветствую. Представляю студию блокчейн-копирайтинга. Предлагаю наши услуги по написанию WhitePaper, созданию видеороликов , написанию уникальных статей и обзоров (в том числе для steemit), переводов. Огромный опыт и большой штат сотрудников. Списко наших услуг и портфолио в нашем телеграм канале или на сайте.
En
Hello everyone! I present to you our blockchain copywriting studio. We propose to you next services: writing WhitePaper, creating videos, , translations, writing unique articles and reviews (Including for steemit). Extensive experience and highly qualified team. List of services and portforlio in our telegram channel or on our website.

Coin Marketplace

STEEM 0.32
TRX 0.11
JST 0.034
BTC 66569.64
ETH 3235.92
USDT 1.00
SBD 4.31