I Just Learned How to Sort Following List by Reputation With HiveSQL—Feels Silly but Exciting!

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@macchiata·
0.000 HBD
I Just Learned How to Sort Following List by Reputation With HiveSQL—Feels Silly but Exciting!
![Mac Property(19).png](https://files.peakd.com/file/peakd-hive/macchiata/246b2fmdczE1sraVi2tMyeMxbJJWaK3mSUgBcoXYpUCMgTQrx9hcbzjpT7j8V4kRFZUUg.png)



There's this awesome tools by @arcange called HiveSQL and if you haven't supported the proposal check out the proposal to keep HIVESQL price "Free" to use ( although you still have to pay 1 HBD) 😂 but it's worth it, **I promise**. Here's the link to the proposal that you can vote on :

<div class="text-justify">

https://peakd.com/hive-139531/@hivesql/poposal-2526


# It all started from this one problem... 

I don't know what got to me but recently, I got back into a problem that's been on my back burner for a while. 

## The problem is simple " unfollowing @lovesniper following that has rep equals and to above 60" 

In the past, I am unfollowing them manually as soon as I see rep "60" but the thing is, the following list keeps growing and it was to the point that I can't keep up. I am not sure if others who's also in @lovesniper feels the same way. So, I thought about how can I sort them easily? 

<center> ![macbrand.png](https://files.peakd.com/file/peakd-hive/macchiata/23sweD6vycN7cwFdHaLE8Ze8ayocMSDoWEAgUZqFJJ9kCXshFpN3tDPaDhXgZr3fLV5ZQ.png) </center>



I tried using HIVESQL with python but somehow, I just couldn't grasp it or maybe I was a noob? So about almost a year has passed today and I finally figured it out. 

The thing is, I recently tried MYSQL again and as much as the flow of the query is still the same, HiveSQL works faster with SSMS ( SQL Server Management Studio). So, after configuring my SSMS, today I learned the rope to retrieve data and write some of my first queries. 

As much as perhaps python would have done it faster and automate it, this is what I find with SQL. 



<center> ![macbrand.png](https://files.peakd.com/file/peakd-hive/macchiata/23sweD6vycN7cwFdHaLE8Ze8ayocMSDoWEAgUZqFJJ9kCXshFpN3tDPaDhXgZr3fLV5ZQ.png) </center>


### How did I solve that problem As a noob? 


- You just have to connect to the HiveSQL (their documentation is pretty extensive)
- Learn how the database diagram works and that's where you'll most likely refer to
- Read the documentation
- Understand some basics
- Write the queries 


```
SQL 

SELECT u.username, u.reputation, u.reputation_ui			
FROM Followers f			
JOIN Users u ON f.following = u.username			
WHERE f.follower = 'insert username' AND u.reputation > insert numerical number		

```

The core of SQL is basically SELECT, FROM, WHERE. The interesting part happens in "WHERE" as you can includes conditionals and basically the things that you want to do. 

I noticed one thing with SQL is that it doesn't accept LIMIT so I have to use TOP command to "limit" the data that I want to gather. 


Thanks to documentation by hivesql and as long as you read it, nothing is impossible. You can get whatever data available that you want to know. 

</div>


<center> ![macbrand.png](https://files.peakd.com/file/peakd-hive/macchiata/23sweD6vycN7cwFdHaLE8Ze8ayocMSDoWEAgUZqFJJ9kCXshFpN3tDPaDhXgZr3fLV5ZQ.png) </center>


<center> Don't hesitate to upvote for more content like this ! You can also support me below! </center>

<center> <a href='https://buymeberri.es/@macchiata' target='_blank'><img src='https://buymeberries.com/assets/bmb-4-s.png'/></a></center>


|||
|-|-
|![profilepic.jpg](https://files.peakd.com/file/peakd-hive/macchiata/AKqch2qeXxDgtt6gewBnVB28roLauVcnbF5T9dypQyjYTV1DhG9mmkdEo7HYkMv.jpg)| <div class="text-justify">𝘔𝘢𝘤 𝘪𝘴 𝘢 𝘴𝘦𝘭𝘧-𝘦𝘮𝘱𝘭𝘰𝘺𝘦𝘥 𝘯𝘪𝘯𝘫𝘢 & 𝘤𝘰𝘧𝘧𝘦𝘦 𝘤𝘰𝘯𝘯𝘰𝘪𝘴𝘴𝘦𝘶𝘳 . 𝘈 𝘵𝘺𝘱𝘪𝘤𝘢𝘭 𝘪𝘯𝘵𝘳𝘰𝘷𝘦𝘳𝘵 𝘪𝘯 𝘭𝘰𝘷𝘦 𝘸𝘪𝘵𝘩 𝘭𝘪𝘵𝘦𝘳𝘢𝘵𝘶𝘳𝘦, 𝘣𝘰𝘰𝘬𝘴, 𝘵𝘦𝘤𝘩𝘯𝘰𝘭𝘰𝘨𝘺 𝘢𝘯𝘥 𝘱𝘩𝘪𝘭𝘰𝘴𝘰𝘱𝘩𝘺.  𝘛𝘩𝘪𝘴 𝘪𝘴 𝘩𝘦𝘳 𝘱𝘦𝘳𝘴𝘰𝘯𝘢𝘭 𝘣𝘭𝘰𝘨, 𝘢 𝘳𝘦𝘧𝘭𝘦𝘤𝘵𝘪𝘰𝘯 𝘰𝘧 𝘩𝘦𝘳 𝘸𝘢𝘯𝘥𝘦𝘳𝘭𝘶𝘴𝘵 𝘢𝘯𝘥 𝘵𝘩𝘪𝘳𝘴𝘵 𝘧𝘰𝘳 𝘬𝘯𝘰𝘸𝘭𝘦𝘥𝘨𝘦. 𝘚𝘩𝘦 𝘰𝘧𝘵𝘦𝘯 𝘤𝘰𝘷𝘦𝘳𝘴 **𝘣𝘰𝘰𝘬𝘴, 𝘮𝘰𝘷𝘪𝘦 𝘢𝘯𝘥 𝘴𝘦𝘳𝘪𝘦𝘴 𝘳𝘦𝘷𝘪𝘦𝘸𝘴, 𝘵𝘦𝘤𝘩 𝘳𝘦𝘷𝘪𝘦𝘸𝘴 𝘢𝘯𝘥 𝘵𝘳𝘦𝘯𝘥𝘴, 𝘱𝘩𝘰𝘵𝘰𝘨𝘳𝘢𝘱𝘩𝘺, 𝘢𝘯𝘥 𝘱𝘦𝘳𝘴𝘰𝘯𝘢𝘭 𝘥𝘦𝘷𝘦𝘭𝘰𝘱𝘮𝘦𝘯𝘵**. 𝘖𝘯𝘤𝘦 𝘪𝘯 𝘢 𝘣𝘭𝘶𝘦 𝘮𝘰𝘰𝘯, 𝘺𝘰𝘶 𝘤𝘢𝘯 𝘧𝘪𝘯𝘥 𝘩𝘦𝘳 𝘵𝘳𝘢𝘷𝘦𝘭𝘪𝘯𝘨, 𝘪𝘮𝘮𝘦𝘳𝘴𝘪𝘯𝘨 𝘩𝘦𝘳𝘴𝘦𝘭𝘧 𝘪𝘯 𝘭𝘰𝘤𝘢𝘭 𝘤𝘶𝘭𝘵𝘶𝘳𝘦𝘴 𝘢𝘯𝘥 𝘵𝘳𝘢𝘥𝘪𝘵𝘪𝘰𝘯𝘴, 𝘢𝘯𝘥 𝘵𝘢𝘬𝘪𝘯𝘨 𝘱𝘪𝘤𝘵𝘶𝘳𝘦𝘴 𝘰𝘧 𝘵𝘩𝘦 𝘣𝘦𝘢𝘶𝘵𝘪𝘧𝘶𝘭 𝘴𝘪𝘨𝘩𝘵𝘴 𝘴𝘩𝘦 𝘦𝘯𝘤𝘰𝘶𝘯𝘵𝘦𝘳𝘴 𝘢𝘭𝘰𝘯𝘨 𝘵𝘩𝘦 𝘸𝘢𝘺. 𝘚𝘩𝘦'𝘴 𝘢𝘯 𝘰𝘤𝘤𝘢𝘴𝘪𝘰𝘯𝘢𝘭 𝘧𝘰𝘰𝘥𝘪𝘦 𝘢𝘯𝘥 𝘭𝘰𝘷𝘦𝘴 𝘵𝘰 𝘦𝘹𝘱𝘭𝘰𝘳𝘦 𝘯𝘦𝘸 𝘢𝘯𝘥 𝘥𝘦𝘭𝘪𝘤𝘪𝘰𝘶𝘴 𝘤𝘶𝘭𝘪𝘯𝘢𝘳𝘺 𝘦𝘹𝘱𝘦𝘳𝘪𝘦𝘯𝘤𝘦𝘴. 𝘍𝘰𝘭𝘭𝘰𝘸 𝘢𝘭𝘰𝘯𝘨 𝘰𝘯 𝘩𝘦𝘳 𝘢𝘥𝘷𝘦𝘯𝘵𝘶𝘳𝘦𝘴 𝘢𝘯𝘥 𝘫𝘰𝘪𝘯 𝘵𝘩𝘦 𝘤𝘰𝘯𝘷𝘦𝘳𝘴𝘢𝘵𝘪𝘰𝘯! 𝘋𝘰𝘯'𝘵 𝘩𝘦𝘴𝘪𝘵𝘢𝘵𝘦 𝘵𝘰 𝘶𝘱𝘷𝘰𝘵𝘦, 𝘭𝘦𝘢𝘷𝘦 𝘢 𝘤𝘰𝘮𝘮𝘦𝘯𝘵 𝘰𝘳 𝘢 𝘧𝘦𝘦𝘥𝘣𝘢𝘤𝘬. 𝘈 𝘳𝘦-𝘣𝘭𝘰𝘨 𝘪𝘴 𝘢𝘭𝘴𝘰 𝘢𝘱𝘱𝘳𝘦𝘤𝘪𝘢𝘵𝘦𝘥 𝘵𝘰𝘰.</div> |</center>

👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,