{"id":116985,"date":"2023-01-16T11:00:00","date_gmt":"2023-01-16T09:00:00","guid":{"rendered":"https:\/\/examples.javacodegeeks.com\/?p=116985"},"modified":"2023-01-14T17:08:56","modified_gmt":"2023-01-14T15:08:56","slug":"sql-intersect-operator","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/","title":{"rendered":"SQL INTERSECT operator"},"content":{"rendered":"<p>Hello. In this tutorial, we will learn the INTERSECT operator in SQL and will use the PostgreSQL database running on Docker.<\/p>\n<h2>1. Introduction<\/h2>\n<p><strong>SQL<\/strong> stands for <em>Structured Query Language<\/em> and is used to extract and organize data stored in relational databases like MySQL, PostgreSQL, Oracle, etc. A relational database consists of rows and columns that allow fetching specific information from databases that can be used later for analysis. In real-time SQL manages a large amount of data that is written and read simultaneously and any query that reaches the SQL server is processed into three parts \u2013<\/p>\n<ul>\n<li><em>Parsing<\/em> \u2013 Process to check the SQL query syntax<\/li>\n<li><em>Binding<\/em> \u2013 Process to check the SQL query semantics<\/li>\n<li><em>Optimization<\/em> \u2013 Process to generate the SQL query execution plan<\/li>\n<\/ul>\n<h3>1.1 Usage of SQL<\/h3>\n<p>Structured Query Language (popularly known as <em>SQL<\/em>) is commonly used by data analysts and data science professionals and is helpful too \u2013<\/p>\n<ul>\n<li>Execute queries against the database<\/li>\n<li>Retrieve data from the database<\/li>\n<li>Insert new records into the database<\/li>\n<li>Update existing records in the database<\/li>\n<li>Created stored procedures, functions, and materialized views in the database<\/li>\n<li>Create users and grant permissions<\/li>\n<li>Set permissions on tables, stored procedures, functions, and materialized views<\/li>\n<\/ul>\n<h3>1.2 INTERSECT operator in SQL<\/h3>\n<ul>\n<li>The INTERSECT\u00a0operator in SQL combines two <code>SELECT<\/code> statements and returns only the dataset common in both statements<\/li>\n<li>Follow the two rules \u2013\n<ul>\n<li>The number and order of columns in both queries have to be the same<\/li>\n<li>Data types of corresponding columns from both the <code>SELECT<\/code> statements must be compatible with each other<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>The INTERSECT\u00a0operator is represented by the below syntax.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Query Syntax<\/em><\/span><\/p>\n<pre class=\"brush:sql; wrap-lines:false;\">select column1 [, column2 ]\n  from table1 [, table2 ]\n  [where condition]\n  intersect\n  select column1 [, column2 ]\n  from table1 [, table2 ]\n  [where condition];<\/pre>\n<h2>2. SQL INTERSECT operator<\/h2>\n<p>Let us dive into some practice implementation on the PostgreSQL database.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3>2.1 Pre-requirement &#8211; Postgres Setup<\/h3>\n<p>Usually, setting up the database is a tedious step but with <a href=\"https:\/\/www.docker.com\/\" target=\"_blank\" rel=\"noopener\">Docker<\/a>, it is a simple process. You can watch the video available at this <a href=\"https:\/\/www.youtube.com\/watch?v=S7NVloq0EBc\" target=\"_blank\" rel=\"noopener\">link<\/a> to understand the Docker installation on Windows OS. Once done open the terminal and trigger the below command to set and run PostgreSQL.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Docker commands<\/em><\/span><\/p>\n<pre class=\"brush:plain; wrap-lines:false;\">-- command to run postgres on docker \u2013\n\n-- remember to change the password --\ndocker run -d -p 5433:5432 -e POSTGRES_PASSWORD= --name postgres postgres\n\n-- command to stop the Postgres docker container --\ndocker stop postgres\n\n-- command to remove the Postgres docker container --\ndocker rm postgres\n<\/pre>\n<p>Remember to enter the password of your choice. If everything goes well the PostgreSQL database server would be up and running on a port number \u2013 <code>5433<\/code> and you can connect with the <a href=\"https:\/\/dbeaver.io\/\" target=\"_blank\" rel=\"noopener\">Dbeaver<\/a> GUI tool for connecting to the server.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/dockerpostgresrun-1.jpg\"><img decoding=\"async\" width=\"818\" height=\"133\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/dockerpostgresrun-1.jpg\" alt=\"\" class=\"wp-image-116986\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/dockerpostgresrun-1.jpg 818w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/dockerpostgresrun-1-300x49.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/dockerpostgresrun-1-768x125.jpg 768w\" sizes=\"(max-width: 818px) 100vw, 818px\" \/><\/a><figcaption class=\"wp-element-caption\">Fig. 1. Postgres on Docker<\/figcaption><\/figure>\n<\/div>\n<h3>2.2 Setting up pre-requisite data<\/h3>\n<p>Create the database named <code>learning<\/code> and add the following table and data to the tables with the help of the below SQL script.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>Pre-requisite SQL script<\/em><\/span><\/p>\n<pre class=\"brush:sql; wrap-lines:false;\">-- customers\ncreate table customers(id serial primary key, name varchar, country varchar, city varchar);\n\ninsert into customers (name, country, city)\nvalues\n('raltofts0', 'Thailand', 'Nang Rong'),('fgariff1', 'China', 'Yuefeng'),('csilcock2', 'France', 'Lacroix-Saint-Ouen'),('mhasluck3', 'Indonesia', 'Cibaregbeg Dua'),('bmerrall4', 'Russia', 'Ust\u2019-Uda'),('scuddon5', 'Greece', 'Nest\u00f3rio'),('amichelet6', 'Vietnam', 'Qu\u00e1n H\u00e0nh'),('hpoon7', 'Colombia', 'Sevilla'),('rchugg8', 'Madagascar', 'Sakaraha'),('pleyland9', 'Seychelles', 'Anse Boileau');\n\nselect id, name, country, city from customers;\n\n-- branches\ncreate table branches(id serial primary key, country varchar, city varchar);\n\ninsert into branches (country, city)\nvalues\n('Russia', 'Neftegorsk'),('Indonesia', 'Krajan Dua Dawuan Wetan'),('Russia', 'Perm'),('China', 'Daxing'),('China', 'Bianzhuang'),('Argentina', 'Ap\u00f3stoles'),('China', 'Jianrao'),('Yemen', 'Al Jab\u012bn'),('Finland', 'Muhos'),('Philippines', 'Kaytitinga'),('China', 'Tekes'),('Indonesia', 'Nanger'),('Russia', 'Podol\u2019sk'),('Russia', 'Lensk'),('Finland', 'Orimattila'),('Vietnam', 'Ph\u01b0\u1edbc An'),('China', 'Dadamtu'),('Poland', 'Pot\u0119gowo'),('Thailand', 'Fao Rai'),('Pakistan', 'Jhumra');\n\nselect id, country, city from branches;\n<\/pre>\n<p>Once the SQL script is executed the mock data will be successfully added to the <code>customers<\/code> and <code>branches<\/code> tables respectively.<\/p>\n<h3>2.3 Playing with the INTERSECT operator<\/h3>\n<p>Use the below <code>SELECT<\/code> keyword to understand the INTERSECT SQLoperator.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>UNION operator<\/em><\/span><\/p>\n<pre class=\"brush:sql; wrap-lines:false;\">-- sql intersect\n-- select query will display the common country records from both tables\nselect country\nfrom customers\nintersect select country\nfrom branches\norder by country;\n\n-- select query will display the common country and city records from both tables\nselect country, city\nfrom customers\nintersect select country, city\nfrom branches\norder by city;\n<\/pre>\n<p>If everything goes well the result of the SQL query will be shown on the console and the usage of the INTERSECT\u00a0operator can be practically understood.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/sqlintersectoperator-project-demoimg1.jpg\"><img decoding=\"async\" width=\"436\" height=\"168\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/sqlintersectoperator-project-demoimg1.jpg\" alt=\"\" class=\"wp-image-116988\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/sqlintersectoperator-project-demoimg1.jpg 436w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/sqlintersectoperator-project-demoimg1-300x116.jpg 300w\" sizes=\"(max-width: 436px) 100vw, 436px\" \/><\/a><figcaption class=\"wp-element-caption\">Fig. 2: INTERSECT operator<\/figcaption><\/figure>\n<\/div>\n<h2>3. Summary<\/h2>\n<p>In this tutorial, we learned the brief of SQL and SQL INTERSECT\u00a0operator via different examples. You can download the SQL scripts used in this tutorial from the <a href=\"#projectDownload\">Downloads<\/a> section.<\/p>\n<h2><a name=\"projectDownload\"><\/a>4. Download the SQL INTERSECT scripts<\/h2>\n<p>This was a tutorial to understand the INTERSECT\u00a0operator in SQL.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>You can download the full source code of this example here: <a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/SQL-intersect-operator.docx\"><strong>SQL INTERSECT operator<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello. In this tutorial, we will learn the INTERSECT operator in SQL and will use the PostgreSQL database running on Docker. 1. Introduction SQL stands for Structured Query Language and is used to extract and organize data stored in relational databases like MySQL, PostgreSQL, Oracle, etc. A relational database consists of rows and columns that &hellip;<\/p>\n","protected":false},"author":119,"featured_media":1204,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[877],"tags":[719,1055],"class_list":["post-116985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql-enterprise-java","tag-postgresql","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL INTERSECT operator - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Hello. In this tutorial, we will learn the INTERSECT operator in SQL and will use the PostgreSQL database running on Docker. 1. Introduction SQL stands\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL INTERSECT operator - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Hello. In this tutorial, we will learn the INTERSECT operator in SQL and will use the PostgreSQL database running on Docker. 1. Introduction SQL stands\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-16T09:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/\"},\"author\":{\"name\":\"Yatin\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\"},\"headline\":\"SQL INTERSECT operator\",\"datePublished\":\"2023-01-16T09:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/\"},\"wordCount\":526,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"keywords\":[\"PostgreSQL\",\"sql\"],\"articleSection\":[\"sql\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/\",\"name\":\"SQL INTERSECT operator - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"datePublished\":\"2023-01-16T09:00:00+00:00\",\"description\":\"Hello. In this tutorial, we will learn the INTERSECT operator in SQL and will use the PostgreSQL database running on Docker. 1. Introduction SQL stands\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"Bipartite Graph\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"sql\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/sql-enterprise-java\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"SQL INTERSECT operator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13\",\"name\":\"Yatin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg\",\"caption\":\"Yatin\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL INTERSECT operator - Java Code Geeks","description":"Hello. In this tutorial, we will learn the INTERSECT operator in SQL and will use the PostgreSQL database running on Docker. 1. Introduction SQL stands","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:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/","og_locale":"en_US","og_type":"article","og_title":"SQL INTERSECT operator - Java Code Geeks","og_description":"Hello. In this tutorial, we will learn the INTERSECT operator in SQL and will use the PostgreSQL database running on Docker. 1. Introduction SQL stands","og_url":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2023-01-16T09:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","type":"image\/jpeg"}],"author":"Yatin","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/"},"author":{"name":"Yatin","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13"},"headline":"SQL INTERSECT operator","datePublished":"2023-01-16T09:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/"},"wordCount":526,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","keywords":["PostgreSQL","sql"],"articleSection":["sql"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/","url":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/","name":"SQL INTERSECT operator - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","datePublished":"2023-01-16T09:00:00+00:00","description":"Hello. In this tutorial, we will learn the INTERSECT operator in SQL and will use the PostgreSQL database running on Docker. 1. Introduction SQL stands","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","width":150,"height":150,"caption":"Bipartite Graph"},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/sql-intersect-operator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/"},{"@type":"ListItem","position":4,"name":"sql","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/sql-enterprise-java\/"},{"@type":"ListItem","position":5,"name":"SQL INTERSECT operator"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9874407a37b028e8be3276e2b5960d13","name":"Yatin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2023\/09\/cropped-Yatin-Batra_avatar_1515758148-96x96.jpg","caption":"Yatin"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/yatin-batra\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/116985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=116985"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/116985\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=116985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=116985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=116985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}