5 Sorting Data with ORDER BY - A Funny Take with Amit Bhadana Characters Part 1

If you're new to SQL, you might be wondering how you can sort the data in your tables. Sorting data in SQL is simple and easy with the ORDER BY clause. You can use ORDER BY to sort data in ascending or descending order based on one or more columns.

To help you understand this concept, we'll take the example of Amit Bhadana characters. Amit Bhadana is a popular Indian YouTuber known for his funny videos and characters. Let's say we have a table called "amit_bhadana_characters" that lists all of his popular characters, their catchphrases, and the number of subscribers they have. Here's what our table looks like:



Character NameCatchphraseSubscribers
BablooBabloo ka pucchta hai, kya bolti2.5M
Amit BhadanaYe mere saath bhi ho chuka hai20M
SameerBhai ka maal hai!3M
RajuRaju ka style hai ye!1M
SultanEk like toh banta hai yaar!5M
Now let's say we want to sort this table in descending order by the number of subscribers each character has. We can do this using the ORDER BY clause like this:


SELECT * FROM amit_bhadana_characters ORDER BY Subscribers DESC;


The "DESC" keyword tells SQL to sort the data in descending order. Here's what our sorted table looks like:
Character NameCatchphraseSubscribers
Amit BhadanaYe mere saath bhi ho chuka hai20M
SultanEk like toh banta hai yaar!5M
SameerBhai ka maal hai!3M
BablooBabloo ka pucchta hai, kya bolti2.5M
RajuRaju ka style hai ye!1M


As you can see, the data is now sorted in descending order based on the number of subscribers each character has. Amit Bhadana's character has the most subscribers, followed by Sultan, Sameer, Babloo, and Raju.

We can also sort the data in ascending order by simply omitting the "DESC" keyword:

vbnet
SELECT * FROM amit_bhadana_characters ORDER BY Subscribers;


This will sort the data in ascending order based on the number of subscribers, with Raju having the least number of subscribers and Amit Bhadana having the most.

In conclusion, the ORDER BY clause is a powerful tool for sorting data in SQL. You can use it to sort data in ascending or descending order based on one or more columns. And as we saw with the example of Amit Bhadana's characters, sorting data can be fun too!

Comments