Friday, January 27, 2023

5 Ways to find the Second Highest Salary of Employee in SQL [Solved]

 Hello guys, if you have attended programming or software development interview then you may have come across SQL queries. In the past, I have shared popular SQL queries from interviews and one of them is how to find the 2nd highest salary of employee in SQL. This is probably the most popular SQL query question I have come across in my career and I have seen it many times. When I first come across this one I have hard time to solve it but over the years, I have learned several ways to solve this problem and find the 2nd highest or even 3rd highest salary in SQL. Earlier, I have shared how to find Nth highest salary and in this article, I am going to share 5 different ways to find the second highest salary in SQL. 

Thursday, January 26, 2023

Top 30 MySQL Interview Questions for 2 to 3 Years Experienced Developers

Hello guys, if you are preparing for MySQL interviews or you are preparing for a tech interviews where MySQL skills are needed and you are looking for MySQL questions then you have come to the right place. Earlier, I have shared 15 SQL queries from interviews and 30 Database Interview Questions and in this article, I am going to share 50+ MySQL questions which you can practice before interviews. These MySQL question touches many different topics on MySQL like Database and SQL related as well MySQL engine specific questions like MyISAM vs InnoDB etc.

How to use LEFT, RIGHT, INNER, OUTER, FULL, and SELF JOIN 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

Top 15 SQL Query Interview Questions for Practice

Hello folks, if you are preparing for technical interviews for software developer, system admin, data analyst, or data scientist, one skill you must prepare is SQL. It's one of the important topic for programmers, support engineers and DBAs as you have to deal with SQL in your day to day job. If you don't know, SQL is the declarative language that allows you to interact with the database. By using SQL you can insert, update, search, and delete data in a relational database. The code you write is called SQL queries and it's one of the essential skills for many technical people who have to deal with databases. That's why SQL queries are very popular in interviews and you will often see one or more SQL queries on interviews. 

Monday, December 12, 2022

2 Ways to remove duplicate rows in SQL? Example Tutorial

Hello guys, if you are wondering how to remove duplicate rows in SQL and looking for solutions on different databases like SQL Server, MySQL, and Oracle then you have come to the right place. In this article, I am going to share 2 ways to remove duplicate rows from SQL, first by using GROUP BY and HAVING clause and second by using the RANK function which works on most of the databases.  You can use any of the approaches to remove duplicates from tables using SQL. This is also one of the popular SQL Interview Questions so knowing how to solve this problem will also give you an edge on interviews. 

How to store and Query Hierarchical Data in Database using SQL? Example Tutorial

What methods do you use to detect hierarchical data and query it? We're about to get answers to two popular SQL queries. When working with SQL and relational databases, querying hierarchical data is a typical occurrence. It's not that hierarchical data is mysterious or uncommon; on the contrary, it's all around us. So, why is hierarchical data so difficult to work within relational databases? The issues arise mostly when converting hierarchical data to relational database concepts.

Thursday, October 13, 2022

Top 30 Database Interview Questions and Answers

 Hello guys, if you are preparing for programming or technical interview then you must prepare for Database and SQL, these two are the most important skill for any programming or software development job be it a Java developer, C++ developer or a web developer. Earlier, I have shared 15 SQL Query Interview Questions and in this article, I am going to share 30 common database interview questions. I am not sharing the answer though as I expect you to already know the answers of these basic Database questions but if you struggle with any questions, ping me on comments section and I might just add the answers as well, depending upon what you guys like.