{"id":79,"date":"2026-03-06T06:30:35","date_gmt":"2026-03-06T06:30:35","guid":{"rendered":"https:\/\/gigz.pk\/sql\/?post_type=lesson&#038;p=79"},"modified":"2026-03-16T18:50:50","modified_gmt":"2026-03-16T18:50:50","slug":"full-join","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/sql\/lesson\/full-join\/","title":{"rendered":"\u00a0FULL JOIN"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A <strong>FULL JOIN<\/strong> is a type of SQL join that returns <strong>all records<\/strong> from both tables involved. If there is a match between the tables, it combines the matching rows. If there is no match, it still returns all rows from both tables, with <strong>NULL values<\/strong> in places where there is no corresponding data.<\/p>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1773567894224\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Key Points<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Combines the results of <strong>LEFT JOIN<\/strong> and <strong>RIGHT JOIN<\/strong>.<\/li>\n\n\n\n<li>Includes <strong>all rows<\/strong> from both tables.<\/li>\n\n\n\n<li>Fills with <strong>NULL<\/strong> for missing matches.<\/li>\n\n\n\n<li>Useful when you need <strong>all data<\/strong> from both tables, not just matches.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Syntax<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The basic syntax of a FULL JOIN is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT column_names<br>FROM table1<br>FULL JOIN table2<br>ON table1.common_column = table2.common_column;<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>table1<\/code> and <code>table2<\/code> are the names of the tables you want to join.<\/li>\n\n\n\n<li><code>common_column<\/code> is the column that exists in both tables and is used for matching.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Suppose you have two tables:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Employees Table<\/strong>: Contains employee IDs and names<br><strong>Departments Table<\/strong>: Contains employee IDs and department names<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using FULL JOIN:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT Employees.ID, Employees.Name, Departments.Department<br>FROM Employees<br>FULL JOIN Departments<br>ON Employees.ID = Departments.ID;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Result<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Shows all employees and their departments.<\/li>\n\n\n\n<li>Employees without departments will have NULL in the Department column.<\/li>\n\n\n\n<li>Departments without employees will have NULL in the Name column.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">When to Use FULL JOIN<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When you need <strong>complete data<\/strong> from both tables.<\/li>\n\n\n\n<li>When you want to <strong>identify unmatched rows<\/strong> in either table.<\/li>\n\n\n\n<li>In <strong>reporting<\/strong> where missing data is important to include.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>FULL JOIN = LEFT JOIN + RIGHT JOIN combined<\/li>\n\n\n\n<li>Returns <strong>all records<\/strong> from both tables<\/li>\n\n\n\n<li>NULLs appear for unmatched rows<\/li>\n\n\n\n<li>Helps in <strong>comprehensive analysis<\/strong> of datasets<\/li>\n<\/ul>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/sql\/\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">SQL Foundations Program (SQL-101) > Basic Joins > FULL JOIN<\/span><\/span><\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"menu_order":27,"template":"","class_list":["post-79","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u00a0FULL JOIN - SQL Learning Hub<\/title>\n<meta name=\"description\" content=\"&quot;Learn SQL FULL JOIN to combine tables, return all rows, and handle unmatched data for complete analysis and reporting.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/sql\/lesson\/full-join\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u00a0FULL JOIN - SQL Learning Hub\" \/>\n<meta property=\"og:description\" content=\"&quot;Learn SQL FULL JOIN to combine tables, return all rows, and handle unmatched data for complete analysis and reporting.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/sql\/lesson\/full-join\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Learning Hub\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-16T18:50:50+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/full-join\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/full-join\\\/\",\"name\":\"\u00a0FULL JOIN - SQL Learning Hub\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/#website\"},\"datePublished\":\"2026-03-06T06:30:35+00:00\",\"dateModified\":\"2026-03-16T18:50:50+00:00\",\"description\":\"\\\"Learn SQL FULL JOIN to combine tables, return all rows, and handle unmatched data for complete analysis and reporting.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/full-join\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/full-join\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/full-join\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Foundations Program (SQL-101) > Basic Joins > FULL JOIN\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/\",\"name\":\"SQL Learning Hub\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u00a0FULL JOIN - SQL Learning Hub","description":"\"Learn SQL FULL JOIN to combine tables, return all rows, and handle unmatched data for complete analysis and reporting.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/sql\/lesson\/full-join\/","og_locale":"en_US","og_type":"article","og_title":"\u00a0FULL JOIN - SQL Learning Hub","og_description":"\"Learn SQL FULL JOIN to combine tables, return all rows, and handle unmatched data for complete analysis and reporting.","og_url":"https:\/\/gigz.pk\/sql\/lesson\/full-join\/","og_site_name":"SQL Learning Hub","article_modified_time":"2026-03-16T18:50:50+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/sql\/lesson\/full-join\/","url":"https:\/\/gigz.pk\/sql\/lesson\/full-join\/","name":"\u00a0FULL JOIN - SQL Learning Hub","isPartOf":{"@id":"https:\/\/gigz.pk\/sql\/#website"},"datePublished":"2026-03-06T06:30:35+00:00","dateModified":"2026-03-16T18:50:50+00:00","description":"\"Learn SQL FULL JOIN to combine tables, return all rows, and handle unmatched data for complete analysis and reporting.","breadcrumb":{"@id":"https:\/\/gigz.pk\/sql\/lesson\/full-join\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/sql\/lesson\/full-join\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/sql\/lesson\/full-join\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/sql\/"},{"@type":"ListItem","position":2,"name":"SQL Foundations Program (SQL-101) > Basic Joins > FULL JOIN"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/sql\/#website","url":"https:\/\/gigz.pk\/sql\/","name":"SQL Learning Hub","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/sql\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/sql\/wp-json\/wp\/v2\/lesson\/79","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/sql\/wp-json\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/sql\/wp-json\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/sql\/wp-json\/wp\/v2\/media?parent=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}