Monday, December 30, 2024

Top 6 Free SQL Courses for Beginners to Learn Online in 2025 - Best of Lot

Hello guys, we are already in the second week of New year, and everyone is talking about their goals to improve them as a better person, a better programmer, or better health. If you have also made your goal, and one of them is to improve your SQL skill, you have come to the right place because I will share some of the free online courses to learn and master SQL this year. The list includes a free course from Udemy, a popular online portal to learn Oracle, PostgreSQL, and Microsoft SQL Server. Yes, I have tried hard to include free courses on different databases to choose the course you want. 

Wednesday, December 25, 2024

Top 5 Udemy Courses to Learn MySQL in 2025 - Best Of Lost

Hello guys, if you are interested in learning SQL with MySQL database and looking for some awesome resources e.g. books, tutorials, and online courses then you have come to the right place. In past, I have shared some useful books and tutorials and in this article, I am going to talk about some of the best MySQL online courses from Udemy, Coursera, and Pluralsight which you can join to learn SQL and MySQL from the comfort of your office or home. In the last couple of years, you might have heard the statement that everybody should learn to code, which is great. Coding is now like reading, writing, and speaking skills and in today's Information technology-centric world it is a must-have and there is no better way to start coding than learning SQL, the most popular programming language.

Tuesday, December 24, 2024

Top 10 Courses to Learn SQL and Database in 2025 - Best of Lot

Hello guys, if you are a computer science graduate or new to the programming world, interested in learning SQL, and looking for some excellent resources, like books, courses, and tutorials to start with, then you have come to the right place. In the past, I have shared some of the best SQL books and tutorials, and today I am going to share some of the best SQL and database courses to learn and master this useful technology. If you don't know what SQL is and why you should learn it, let me give you a brief overview of SQL for everyone's benefit. SQL is a programming language to work with a database. You can use SQL to create database objects, like tables, stored procedures, etc., and also to store and retrieve data from the database.

Monday, December 23, 2024

Top 7 Courses to learn PostgreSQL Database in 2025 - Best of Lot

PostgreSQL is one of the most popular databases after the big three - Oracle, SQL Server, and MySQL. PostgreSQL is commonly known as Postgres and is often referred to as the world's most advanced open source database. If you are looking to learn PostgreSQL in 2025 and looking for some useful resources like books, tutorials, and courses then you have come to the right place. In this article, I am going to share some of the best PostgreSQL online courses for beginners. These courses will cover topics ranging from installations to writing basic queries and retrieving data from tables. you will also explore the logic of SQL Joins, and a few best practices which are essential while working in a real-world, production PostgreSQL database.

Wednesday, December 11, 2024

The multi-part identifier XXX could not be bound in SQL SERVER [Solution]

Problem, I was doing join statement and getting this error Msg 4104, Level 16, State 1, Line 69

The multi-part identifier "a.X" could not be bound."


Cause:

I was mixing implicit joins with explicit joins. That is allowed, but you need to be aware of how to do that properly.

The thing is, explicit joins (the ones that are implemented using the JOIN keyword) take precedence over implicit ones (the 'comma' joins, where the join condition is specified in the WHERE clause).

Sunday, October 20, 2024

Top 5 Websites to Learn SQL Online for FREE - Best of Lot

SQL is one of the most important skills for any programmer be it a Java, C++, Python, JavaScript, or Ruby developer. Almost 95% of the Java applications use a relational database in their back-end and almost all web applications use the database. In recent years, one of the most common ways to learn any programming skill is online, at your comfort of the office or home and SQL is no different. Learning SQL online has another advantage of a quick head start because you don't need to install a database and create tables to write some SELECT queries. 

Thursday, October 3, 2024

How to replace NULL with Empty String in SQL Server? ISNULL() vs COALESCE() Examples

We often need to replace NULL values with empty String or blank in SQL e.g. while concatenating String. In SQL Server, when you concatenate a NULL String with another non-null String the result is NULL, which means you lose the information you already have. To prevent this, you can replace NULL with empty String while concatenating. There are two ways to replace NULL with blank values in SQL Server, function ISNULL(), and COALESCE(). Both functions replace the value you provide when the argument is NULL like ISNULL(column, '') will return empty String if the column value is NULL.

Wednesday, October 2, 2024

Difference between char, varchar, nchar and nvarchar data types in SQL Server? Example

What is the difference between char and varchar in SQL, followed by nchar and nvarchar, is one of the popular SQL interview questions, and surprisingly not every programmer knows this basic difference. If you go with the name, which you should, then you can figure out that char is a fixed-length data type while varchar should be a variable-length data type. Though all char, varchar, nchar, and nvarchar are used to store text or String data there are subtle differences between them. As I said char is fixed length, which means a variable or a column like Zipcode char(10) will take only 10 bytes to store data, including space.

Top 5 Books to Learn SQL and Database Design for Programmers and DBAs - Best of Lot

The database design and modeling are one of those topics which rarely get the attention they deserve, especially at the start of the project, but once things have gone out of hand, then everybody talks about them. Comments like - this database is designed poorly, the schema is not performing well, you cannot add a new column easily, etc. becomes very common. The most problem with database design is that it is mainly done by application developers like Java or C++ developer who knows SQL, but they are not the expert on how to design tables and schema. 

Thursday, September 26, 2024

How to Find Duplicate values in a Table? SQL GROUP BY and Having Example| Leetcode Solution

Hello guys, if you are wondering how to find duplicate values in a table then don't worry, there are many ways to find duplicate rows or values from a given table. For example, you can use the GROUP BY and HAVING clause in SQL with count function to find all the rows which has same values for a particular column and then filter out rows where count is just one, I mean unique values. This way you can find all the duplicate from a given table. Using group by you can create groups and if your group has more than 1 element it means it's kind of duplicate.

How to use EXISTS and NOT Exists in SQL? Example Query and Tutorial

Hello Guys, you might have heard about how useful the EXISTS clause is helpful in writing sophisticated queries. Still, at the same time, I have also seen that many programmers struggle to understand and use EXISTS and NOT EXISTS clauses while writing SQL queries.  If you are one of them, then you have come to the right place. Today you will learn how to use the EXISTS clause in SQL by picking up a real-world example and an excellent SQL exercise from the LeetCode. Suppose that a website contains two tables, the Customers table, and the Orders table. Can you write an SQL query to find all customers who have never ordered anything?

Tuesday, September 24, 2024

Top 10 SQL SELECT Query Examples for Beginners

The Select command in SQL is one of the most powerful and heavily used commands. This is I guess the first command anyone learns in SQL even before CREATE which is used to create a table in SQL. SELECT is used in SQL to fetch records from database tables and you can do a lot many things using Select. For example, you can select all records, you can select few records based on the condition specified in the WHERE clause, select all columns using the wild card (*) or only selecting a few columns by explicitly declaring them in a query.

Monday, September 16, 2024

ORA-00904: invalid identifier Error in Oracle 11g database - Solved

If you have worked in the Oracle database ever, you would definitely have seen ORA-00904: invalid identifier error. Doesn't matter which version you are working 10g, 11g or 12g, this is one of the most common error comes while doing CRUD (Create, Read, Update, and Delete) operations in Oracle. By the way, if you are a beginner, SELECT, INSERT, UPDATE and DELETE are used to perform CRUD operations in the Oracle database. What do you do if you get this error while running in SQL script? Like any error, you should first pay attention to error message, what is Oracle trying to say here. Invalid identifier means the column name entered is either missing or invalid, this is one of the most common causes of this error but not the only one.

Difference between LEFT and RIGHT OUTER Joins in SQL - MySQL Join example

There are two kinds of OUTER joins in SQL, LEFT OUTER join and RIGHT OUTER join. The main difference between RIGHT OUTER joins and LEFT OUTER join, as their name suggests, is the inclusion of non-matched rows. Sine INNER join only include matching rows, where the value of the joining column is the same, in the final result set, but OUTER join extends that functionality and also include unmatched rows in the final result. LEFT outer join includes unmatched rows from the table written on the left of the join predicate. 

Sunday, July 14, 2024

17 SQL Query Best Practices Every Developer Should Learn

Hello guys, its no secret that SQL is one of the must have skill in this data driven world and its also one of those skills which is equally useful for programmers, developers, database admins, data scientists, data analyst, business analyst, quality analyst and even project managers. I first learned SQL 20 years back when I was in college and that time we are using Oracle database. I still remember my first query about "SELECT * FROM EMP",  EMP was one of the tables which was quite popular among learners and most of the Oracle DB instance on labs have that. 

Tuesday, July 2, 2024

Top 12 SQL Query Problems for Coding Interviews (with Solutions)

Hello guys, if you are looking for SQL query examples from interviews or SQL Query Practice questions to improve your SQL skill or just to prepare for tech interviews  then you have come to the right place. Earlier, I have shared best websites to learn SQL and Practice Query online and in this article, I am going to share 12 popular SQL query questions from interviews. SQL is an important skills for both programmers and data scientist, even people from QA and BA stream also need to know SQL to do their job well in this era or data driven world. That's why SQL queries are also quite popular on interviews. 

Monday, June 24, 2024

Top 5 SQL Server Tips for Beginners and Junior DBAs

Hello guys, If you are using Microsoft SQL Server database and use SQL Server Management Studio in your day to day work and looking for SQL Server tips to improve productivity and work fast and efficiently then you have come to the right place. Earlier, I have shared SQL Server online courses, SQL Server Interview questions and SQL Server Management Studio keyboard shortcuts and today, I am going to share amazing tips to make most of SSMS. These are the tips I learned hard way after working close to 8 years on SQL Server backend.

Saturday, May 25, 2024

12 Intermediate Database Administrator and Developer Interview Questions on Indexing

A good understanding of Index is very important for any programmer working with database and SQL. It doesn't matter whether you are working as DBA or Application developer, working in Oracle, MySQL, or Microsoft SQL Server or any other database, you must have good understanding of how index works in general. You should know different types of index and their pros and cons, how your database or Query engine chooses indexes and the impact of table scan, index scan, and index seek. You should also be able to build upon your knowledge to optimize your SQL queries as well as troubleshoot a production issue involving long running queries or poor performing queries. This is also a great skill for experience developers with 5 to 6 years of experience under his belt. 

Monday, April 8, 2024

4 Ways to find Nth highest salary in SQL - Oracle, MSSQL and MySQL

One of the most common SQL interview questions is to find the Nth highest salary of employees, where N could be 2, 3, 4 or anything e.g. find the second highest salary in SQL. Sometimes this question is also twisted as to find the nth minimum salary in SQL. Since many Programmers only know the easy way to solve this problem e.g. by using SQL IN clause, which doesn't scale well, they struggle to write the SQL query when the Interviewer keeps asking about the 4th highest, 5th highest and so on. In order to solve this problem effectively, you need to know about some key concepts like a correlated subquery, window functions like ROW_NUMER(), RANK(), and DENSE_RANK()etc. Once you know the generic logic to solve this problem, you can tackle all those variations by yourself.

Sunday, April 7, 2024

SQL Self Join Example - SQL Query to Find Employees Earning More Than Managers - LeetCode Solution

Hello guys, are you looking for a simple example of how to use SELF JOIN in SQL? If yes, then you have come to the right place. This article will show you how to use Self join in solving interesting SQL problems from LeetCode. Along the way, you will also learn this useful SQL concept. So, what are you waiting for? Let's first check the problem, and then we'll write an SQL query using SELF Join to solve this problem.

Write an SQL Query to Find Employees Earning More Than Managers
The Employee table holds all employees, including their managers. Every employee has an Id, and there is also a column for the manager Id, as shown below:

+----+-------+--------+-----------+
| Id | Name  | Salary | ManagerId |
+----+-------+--------+-----------+
| 1  | Joe   | 70000  | 3         |
| 2  | Henry | 80000  | 4         |
| 3  | Sam   | 60000  | NULL      |
| 4  | Max   | 90000  | NULL      |
+----+-------+--------+-----------+

Given the Employee table, write a SQL query that finds employees who earn more than their managers. For the above table, Joe is the only employee who earns more than his manager because Henry's Manager is Max, who earns 90000, which is more than Henry's salary of 80000.