SQLrevisited
Blog to learn about SQL, database, Oracle, SQL Server, MySQL, PostgreSQL concepts and much more.
Monday, May 19, 2025
How to Sort or Order results in SQL query? ORDER BY Example Tutorial
How to find Nth Highest Salary of Employee in SQL? Example Tutorial
The Problem description
Finding the Nth highest salary of workers, where N might be 2, 3, 4, or anything, is one of the most typical SQL interview questions. This query is sometimes rephrased as "find the nth minimal wage in SQL." Many programmers struggle to design the SQL query when the Interviewer keeps asking for the 4th highest, 5th highest, and so on since they only know the easiest approach to address this problem, like by utilizing the SQL IN clause, which doesn't scale well.
Difference between Correlated and Non-Correlated SubQuery in SQL
Friday, May 16, 2025
How to use LEFT, RIGHT, INNER, OUTER, FULL, and SELF JOINs in SQL? Example Tutorial
What are joins and why are they required?
Hello, everyone. Have you ever faced any issues while generating reports or loading data but were using data of just one table was not enough? One table's data is typically insufficient to provide important insights when doing sophisticated analytical processing and data discovery, therefore merging numerous tables is required. SQL, as a method for communicating with relational databases, allows you to create relationships between tables
How do I perform an IF...THEN in an SQL SELECT?
Hey there! Today, I'm going to take you on a journey through the fascinating world of SQL, and we're going to dive headfirst into the intriguing realm of the IF...THEN statement within an SQL SELECT query. Don't fret; it's not as complicated as it sounds. So, grab your favorite coding beverage, settle in, and let's unravel this SQL mystery together.