Difference between JOIN and UNION in SQL Last Updated : 12 Jul, 2025 Comments Improve Suggest changes 25 Likes Like Report Pre-requisites: JOIN, UNION JOIN in SQL is used to combine data from many tables based on a matched condition between them. The data combined using the JOIN statement results in new columns. Consider the two tables: Boys Girls Example: sql> SELECT Boys.Name, Boys.Age, Girls.Address, FROM Boys INNER JOIN Girls ON Boys.Rollno = Girls.Rollno; The resultant table is: NameAgeAddressRitik15DelhiPrakhar17BhopalSanjay16GoaUNION in SQL is used to combine the result set of two or more SELECT statements. The data combined using the UNION statement is into results into new distinct rows. Example: sql> SELECT Name FROM Boys WHERE Rollno < 16 UNION SELECT Name FROM Girls WHERE Rollno > 9 Output: NameRamJayantRimiSeemaMonaDifference between JOIN and UNION in SQL JOINUNIONJOIN combines data from many tables based on a matched condition between them SQL combines the result set of two or more SELECT statements. It combines data into new columns. It combines data into new rows The number of columns selected from each table may not be the same. The number of columns selected from each table should be the same. Datatypes of corresponding columns selected from each table can be different. The data types of corresponding columns selected from each table should be the same. It may not return distinct columns. It returns distinct rows. Create Quiz Comment D dhruv5819 Follow 25 Improve D dhruv5819 Follow 25 Improve Article Tags : DBMS Difference Between GATE CS SQL-Clauses DBMS-Join +1 More Explore Basics of DBMSIntroduction of DBMS6 min readHistory of DBMS7 min readDBMS Architecture 1-level, 2-Level, 3-Level6 min readDifference between File System and DBMS6 min readER & Relational ModelIntroduction of ER Model9 min readStructural Constraints of Relationships in ER Model5 min readGeneralization, Specialization and Aggregation in ER Model4 min readIntroduction of Relational Model and Codd Rules in DBMS14 min readKeys in Relational Model6 min readMapping from ER Model to Relational Model5 min readStrategies for Schema design in DBMS6 min readRelational AlgebraIntroduction of Relational Algebra in DBMS8 min readSQL Joins (Inner, Left, Right and Full Join)4 min readJoin operation Vs Nested query in DBMS3 min readTuple Relational Calculus (TRC) in DBMS4 min readDomain Relational Calculus in DBMS4 min readFunctional Dependencies & NormalisationAttribute Closure in DBMS4 min readArmstrong's Axioms in Functional Dependency in DBMS4 min readCanonical Cover of Functional Dependencies in DBMS7 min readNormal Forms in DBMS5 min readThe Problem of Redundancy in Database3 min readLossless Join and Dependency Preserving Decomposition4 min readDenormalization in Databases4 min readTransactions & Concurrency ControlACID Properties in DBMS5 min readTypes of Schedules in DBMS5 min readConcurrency Control in DBMS3 min readGraph Based Concurrency Control Protocol in DBMS3 min readMultiple Granularity Locking in DBMS3 min readDatabase Recovery Techniques in DBMS4 min readDeadlock in DBMS4 min readAdvanced DBMSIndexing in Databases6 min readIntroduction of B Tree8 min readIntroduction of B+ Tree5 min readBitmap Indexing in DBMS3 min readInverted Index7 min readSQL Queries on Clustered and Non-Clustered Indexes6 min readFile Organization in DBMS4 min readPractice QuestionsLast Minute Notes - DBMS15+ min readDBMS Interview Questions with Answers15+ min readCommonly asked DBMS Interview Questions | Set 25 min readDatabase Management System - GATE CSE Previous Year Questions2 min read Like