Hello guys, if you are wondering how to join multiple tables in SQL to produce a combine result which contains columns from all tables but not sure how to do it then you have come to the right place. SQL Join is one of the basic concepts while working in databases or tables but yet less understood and most confusing topic for beginners and even intermediate developers. I compare Joins in SQL with Recursion in programming in terms of confusion because I have found that these two topics are special in their nature and you can't get it right with casual reading until you understand the concept and its various well.
Blog to learn about SQL, database, Oracle, SQL Server, MySQL, PostgreSQL concepts and much more.
Saturday, February 22, 2025
Thursday, February 20, 2025
How to Join Two Unrelated Tables in SQL using Cross Join? Example
In one of the recent programming job interviews, one of my readers was asked the question, how do you join two tables which are not related to each other? i.e. they don't have any common column? is it possible in SQL? My reader got confused because he only knows about INNER join and OUTER join which require a key column like dept_id which is the primary key in one table like Department and foreign key in another table like Employee. He couldn't answer the question, though he did tell them about you can select data from multiple tables by typing multiple table names in from clause using a comma.
Wednesday, February 19, 2025
Difference between Candidate Key vs Primary Key in Database/SQL
Tuesday, February 18, 2025
What is Difference between Clustered vs Non-Clustered Indexes in a table? [SQL Interview Question]
Thursday, February 13, 2025
Top 10 SQL Server Functions Programmer Should Learn (with Examples)
Hey there! SQL Server functions are like magic spells in the enchanted forest of databases. They can transform your data and make it dance to your tune. In this article, I'm going to share my top 10 SQL Server functions that every programmer should have in their toolkit.