{"id":12770,"date":"2021-10-06T07:09:55","date_gmt":"2021-10-06T14:09:55","guid":{"rendered":"https:\/\/www.springboard.com\/?p=12770"},"modified":"2023-09-28T00:36:01","modified_gmt":"2023-09-28T07:36:01","slug":"what-is-sql","status":"publish","type":"post","link":"https:\/\/www.springboard.com\/blog\/data-analytics\/what-is-sql\/","title":{"rendered":"What Is SQL &#038; How Does It Work? A Guide to Structured Query Language"},"content":{"rendered":"\n<p>SQL or Structured Query Language is a critical tool for data professionals. It is undoubtedly the most important language for getting a job in the field of data analysis or data sciences. <\/p>\n\n\n\n<p>Millions of data points are being generated every minute and raw data does not have any story to tell. After all this data gets stored in databases and professionals use SQL to extract this data for further analysis. <\/p>\n\n\n\n<p>In this blog post, we will cover what is SQL and how does it work. SQL is fairly simple, thanks to easy syntaxes of this language. Let\u2019s dig into understanding this Structured Query Language by asking this simple question.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is SQL And How Does it Work?<\/strong><\/h2>\n\n\n\n<p>SQL is the most common language for extracting and organising data that is stored in a relational database. A database is a table that consists of rows and columns. SQL is the language of databases. It facilitates retrieving specific information from databases that are further used for analysis. Even when the analysis is being done on another platform like Python or R, SQL would be needed to extract the data that you need from a company&#8217;s database.<\/p>\n\n\n<style>.blog-cta-salsey-03 {\toverflow: hidden;\t}\t.blog-cta-salsey-03-img {\tmax-width: 160px !important;\t}\t@media (min-width: 768px) {\t.blog-cta-salsey-03-content {\tmax-width: calc(100% - 281px);\t}\t.blog-cta-salsey-03-img {\tposition: absolute;\tmax-width: 100% !important;\tright: -10px;\tbottom: -10px;\t}\t}<\/style><div class=\"blog-cta-salsey-03 bg-blue-50 p-3 my-5 position-relative\"><div class=\"d-block d-md-flex\"><img decoding=\"async\" loading=\"lazy\" width=\"212\" height=\"232\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2023\/08\/dac-student.png\" alt=\"Data Analyst student\" class=\"blog-cta-salsey-03-img mb-3 mb-md-0\" \/><div class=\"blog-cta-salsey-03-content\"><div class=\"d-flex align-items-center mb-2\"><img decoding=\"async\" class=\"pe-2\" width=\"86\" height=\"71\" loading=\"lazy\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2023\/04\/job-guarantee-heading-badge.png\" alt=\"Job Guarantee\" style=\"mix-blend-mode: multiply\"><h4 class=\"fw-bold mb-0\">Become a Data Analyst. Land a Job or Your Money Back.<\/h4><\/div><p>Transform real-world datasets into actionable recommendations. Master technical and strategic thinking skills and frameworks. Land a job \u2014 or your money back.<\/p><p class=\"mb-sm-0\"><a class=\"btn btn-primary btn-lg\" href=\"https:\/\/www.springboard.com\/courses\/data-analytics-career-track\/#job-guarantee\">Explore course<\/a><\/p><\/div><\/div><\/div>\n\n\n\n<p><strong>SQL manages a large amount of data, especially if there is a lot of data that is being written simultaneously and there are too many data transactions. <\/strong><\/p>\n\n\n\n<p>There are different versions and frameworks for SQL, the most commonly used is MySQL. MySQL is an open-source solution that helps facilitate SQL\u2019s role in managing back-end data for web applications. Companies such as Facebook, Instagram, WhatsApp, etc. all use SQL for back-end data storage and data processing solutions. When an SQL query is written &amp; run (or parsed), it is processed by a query optimiser. The query reaches SQL server, where it compiles in three phases; Parsing, Binding and Optimisation.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Parsing &#8211; A process to check the syntax<\/li>\n\n\n\n<li>Binding &#8211; A process to check the query semantics<\/li>\n\n\n\n<li>Optimisation &#8211; A process to generate the query execution plan<\/li>\n<\/ul>\n\n\n\n<p>In the third step, all possible permutations and combinations are generated to find the most effective query execution plan in a reasonable time. The shorter the query takes, the better it is.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is SQL Used for?<\/strong><\/h2>\n\n\n\n<p>Now that we understand what is SQL and how does it work, let&#8217;s try to see what SQL can do. This programming language has various uses for <a href=\"https:\/\/www.springboard.com\/blog\/data-analytics\/what-does-data-analyst-do\/\" data-type=\"URL\" data-id=\"https:\/\/www.springboard.com\/blog\/data-analytics\/what-does-data-analyst-do\/\">data analysts<\/a> &amp; data science professionals. It is particularly helpful because it can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Execute queries against a database<\/li>\n\n\n\n<li>Retrieve data from a database<\/li>\n\n\n\n<li>Insert records into a database<\/li>\n\n\n\n<li>Update records in a database<\/li>\n\n\n\n<li>Delete records from a database<\/li>\n\n\n\n<li>Create new databases, or new tables in a database<\/li>\n\n\n\n<li>Create stored procedures &amp; views in a database<\/li>\n\n\n\n<li>Set permissions on tables, procedures, and views<\/li>\n<\/ul>\n\n\n\n<p>Imagine how difficult life would be if we did not have a way to control the database in this format. After getting a sense of what SQL is used for, let\u2019s try our hands at learning SQL on an actual database.<\/p>\n\n\n<div class=\"bg-leaf-50 p-4 my-3\"><h4 class=\"fw-bold text-center\">Get To Know Other\tData Analytics Students<\/h4><div class=\"row row-cols-1 row-cols-lg-3\"><div class=\"col\"><div class=\"card success-story-card h-100 d-flex justify-content-between mb-0\"><div class=\"flex-grow-1 text-center\"><a class=\"d-inline-block rounded-circle\" href=\"\/success\/cleo-valencia\" style=\"width:125px;height:125px;overflow:hidden\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/res.cloudinary.com\/springboard-images\/image\/upload\/v1699384654\/Cleo_Valencia_1.jpg\" alt=\"Cleo Valencia\" style=\"object-fit:contain;max-width:170px;height:125px\" \/><\/a><p class=\"fw-bold mb-0\">Cleo Valencia<\/p><p class=\"text-muted lh-1\">Student In The Data Analytics Bootcamp at Springboard<\/p><\/div><div class=\"w-100 d-block d-md-none mt-3\"><\/div><p class=\"mb-0 mx-auto text-center\"><a class=\"btn btn-primary mx-auto\" href=\"\/success\/cleo-valencia\">Read Story<\/a><\/p><\/div><\/div><div class=\"col d-none d-md-block\"><div class=\"card success-story-card h-100 d-flex justify-content-between mb-0\"><div class=\"flex-grow-1 text-center\"><a class=\"d-inline-block rounded-circle\" href=\"\/success\/shelly-applegate\" style=\"width:125px;height:125px;overflow:hidden\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/res.cloudinary.com\/springboard-images\/image\/upload\/v1682911751\/Shelly_Applegate_1.jpg\" alt=\"Shelly Applegate\" style=\"object-fit:contain;max-width:170px;height:125px\" \/><\/a><p class=\"fw-bold mb-0\">Shelly Applegate<\/p><p class=\"text-muted lh-1\">Sales BI Analyst at Mars Corporation<\/p><\/div><p class=\"mb-0 mx-auto text-center\"><a class=\"btn btn-primary mx-auto\" href=\"\/success\/shelly-applegate\">Read Story<\/a><\/p><\/div><\/div><div class=\"col d-none d-md-block\"><div class=\"card success-story-card h-100 d-flex justify-content-between mb-0\"><div class=\"flex-grow-1 text-center\"><a class=\"d-inline-block rounded-circle\" href=\"\/success\/rahil-jetly\" style=\"width:125px;height:125px;overflow:hidden\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/res.cloudinary.com\/springboard-images\/image\/upload\/v1558688241\/homepage-assets\/career-tracks\/sp-aic\/application-process\/admissions-rahil.png\" alt=\"Rahil Jetly\" style=\"object-fit:contain;max-width:170px;height:125px\" \/><\/a><p class=\"fw-bold mb-0\">Rahil Jetly<\/p><p class=\"text-muted lh-1\">Sales Operations Manager at Springboard<\/p><\/div><p class=\"mb-0 mx-auto text-center\"><a class=\"btn btn-primary mx-auto\" href=\"\/success\/rahil-jetly\">Read Story<\/a><\/p><\/div><\/div><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">What Is SQL And How Does It Work: <strong>Learning SQL With Some Basic SQL Commands<\/strong><\/h2>\n\n\n\n<p>We have learned above what SQL is used for, so let\u2019s try out each of these things on a real dataset. As an example, we have chosen a database of customers at an e-commerce store. This is what it looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1147\" height=\"738\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sample-of-database-of-e-commerce-store-customers.png\" alt=\"What Is SQL And How Does It Work, sample of database of e-commerce store customers\" class=\"wp-image-46926\" srcset=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sample-of-database-of-e-commerce-store-customers.png 1147w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sample-of-database-of-e-commerce-store-customers-400x257.png 400w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sample-of-database-of-e-commerce-store-customers-768x494.png 768w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sample-of-database-of-e-commerce-store-customers-380x244.png 380w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sample-of-database-of-e-commerce-store-customers-700x450.png 700w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sample-of-database-of-e-commerce-store-customers-380x244.png 420w\" sizes=\"(max-width: 1147px) 100vw, 1147px\" \/><figcaption class=\"wp-element-caption\">Source: <a href=\"https:\/\/www.mysql.com\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.mysql.com\/\" rel=\"noreferrer noopener\">MySQL<\/a><\/figcaption><\/figure>\n\n\n\n<p>Here are some commands that we will be learning about, and later practicing as well.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Command<\/td><td>Description<\/td><\/tr><tr><td>CREATE<\/td><td>Creates a new table, a view of a table, or another object in the database.<\/td><\/tr><tr><td>ALTER<\/td><td>Modifies an existing database object, such as a table.<\/td><\/tr><tr><td>DROP<\/td><td>Deletes an entire table, a view of a table or other objects in the database.<\/td><\/tr><tr><td>SELECT<\/td><td>Retrieves certain records from one or more tables.<\/td><\/tr><tr><td>INSERT<\/td><td>Creates a record.<\/td><\/tr><tr><td>UPDATE<\/td><td>Modifies a record.<\/td><\/tr><tr><td>DELETE<\/td><td>Deletes a record.<\/td><\/tr><tr><td>GRANT<\/td><td>Gives a privilege to users.<\/td><\/tr><tr><td>REVOKE<\/td><td>Takes back privileges granted from users.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>If you notice, the commands \u2018create, alter &amp; drop\u2019 define the complete structure of data. They come under the \u2018Data Definition Language\u2019 set of commands. Similarly, \u2018select, insert, update, delete\u2019 fall under Data Manipulation Language &amp; \u2018grant, revoke\u2019 come under Data Control Language set of commands. <\/p>\n\n\n\n<p>Let\u2019s write some SQL commands and understand what the outcomes would be like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT WHERE<br>SELECT * FROM Customers<br>WHERE Country='Mexico';<\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1145\" height=\"282\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-select-where.png\" alt=\"SQL commands, select where\" class=\"wp-image-46927\" srcset=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-select-where.png 1145w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-select-where-400x99.png 400w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-select-where-768x189.png 768w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-select-where-380x94.png 380w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-select-where-700x172.png 700w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-select-where-380x94.png 420w\" sizes=\"(max-width: 1145px) 100vw, 1145px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">AND OR <br>SELECT * FROM Customers<br>WHERE Country='Germany' AND (City='Berlin' OR City='M\u00fcnchen');<\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1141\" height=\"168\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-and-or.png\" alt=\"SQL commands, and or\" class=\"wp-image-46928\" srcset=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-and-or.png 1141w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-and-or-400x59.png 400w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-and-or-768x113.png 768w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-and-or-380x56.png 380w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-and-or-700x103.png 700w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/sql-commands-and-or-380x56.png 420w\" sizes=\"(max-width: 1141px) 100vw, 1141px\" \/><\/figure>\n\n\n\n<p>Here is how you can write the syntax for other functions:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1040\" height=\"720\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sql-cheat-sheet.png\" alt=\"What Is SQL And How Does It Work, SQL Cheat Sheet\" class=\"wp-image-46929\" srcset=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sql-cheat-sheet.png 1040w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sql-cheat-sheet-400x277.png 400w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sql-cheat-sheet-768x532.png 768w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sql-cheat-sheet-380x263.png 380w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sql-cheat-sheet-700x485.png 700w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-sql-cheat-sheet-380x263.png 420w\" sizes=\"(max-width: 1040px) 100vw, 1040px\" \/><figcaption class=\"wp-element-caption\">Source: <a href=\"http:\/\/SQLTutorial.org\" target=\"_blank\" data-type=\"URL\" data-id=\"SQLTutorial.org\" rel=\"noreferrer noopener\">SQLTutorial<\/a><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How SQL Works When Joining Tables<\/strong><\/h3>\n\n\n\n<p>An SQL join clause is like a  join operation in relational algebra. It combines the columns from one or more tables in a relational database to create a set that can be saved as a table or used as it is. A <strong>JOIN<\/strong> is a means for combining columns from one or more tables by using values common to each. A critical skill, and a frequently asked interview question, <strong>JOINS<\/strong> help you get a lot of work done with complex databases. Having the ability to manipulate JOIN queries with precision will give you an added advantage. <\/p>\n\n\n\n<p>There are 4 major JIONS to combine data or rows from two or more tables based on a common field between them. Different types of Joins are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>INNER JOIN<\/li>\n\n\n\n<li>LEFT JOIN<\/li>\n\n\n\n<li>RIGHT JOIN<\/li>\n\n\n\n<li>FULL JOIN<\/li>\n<\/ul>\n\n\n\n<p>A JOIN is an SQL instruction in the FROM clause of your query that is used to identify the tables you are querying and how they should be combined. But before we actually start joining tables, let\u2019s learn about primary key &amp; foreign key.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Primary Keys<\/strong><\/li>\n<\/ul>\n\n\n\n<p>A primary key is a column (or sometimes set of columns) in a table that is a unique identifier for each row. It is very common for databases to have a column named id (customerID, emailID, EmployeeID) as a primary key for each table.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"425\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1200x425.png\" alt=\"What Is SQL And How Does It Work, primary keys and foreign keys\" class=\"wp-image-46930\" srcset=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1200x425.png 1200w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-400x142.png 400w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-768x272.png 768w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-380x135.png 380w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-700x248.png 700w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys.png 1258w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-380x135.png 420w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><figcaption class=\"wp-element-caption\">Source: <a href=\"https:\/\/www.dataschool.io\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.dataschool.io\/\" rel=\"noreferrer noopener\">DataSchool<\/a><\/figcaption><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Foreign Keys<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Foreign keys are columns in a table that specify a link to a primary key in another table. For instance, in the image above, the artist_id column in the albums table is a foreign key to id in the artists table. <\/p>\n\n\n\n<p>Coming back to JOINS, let\u2019s look at the below datasets to understand how they would work:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"492\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1.png\" alt=\"What Is SQL And How Does It Work, primary keys and foreign keys\" class=\"wp-image-46931\" srcset=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1.png 1024w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1-400x192.png 400w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1-768x369.png 768w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1-380x183.png 380w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1-700x336.png 700w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-primary-keys-and-foreign-keys-1-380x183.png 420w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Source: <a href=\"https:\/\/www.dataschool.io\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.dataschool.io\/\" rel=\"noreferrer noopener\">DataSchool<\/a><\/figcaption><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>For instance, you want to have a table that contains all your user and event table data together<\/strong><\/li>\n<\/ul>\n\n\n\n<p>For this, you will use an Outer Join. An Outer Join will combine the columns from all tables on one or more common dimensions when possible, and includes all data from all tables.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What if you want to have a table that contains only users that have done an action?<\/strong><\/li>\n<\/ul>\n\n\n\n<p>This is where an Inner Join comes in play. An Inner Join would combine the columns on a common dimension (the first N columns) when possible, and only include the data for the columns that share the same values in the common N column(s). In the above example, the User_ID would be the common dimension used for the inner join.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Now, what if you want to have a table that contains all the users\u2019 data and only actions that those users have done? Actions performed by other users, not in the user table should not be included?<\/strong><\/li>\n<\/ul>\n\n\n\n<p>You would use a Left Join to join the tables together. A Left Join combines the columns on a common dimension (the first N columns) when possible, returning all rows from the first table with the matching rows in the consecutive tables. The result is NULL in the consecutive tables when there is no match. In this case, we would make the User Table the first (left table) to use for the Left Join.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"672\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-combining-data-tables.png\" alt=\"What Is SQL And How Does It Work, combining data tables\" class=\"wp-image-46932\" srcset=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-combining-data-tables.png 1024w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-combining-data-tables-400x263.png 400w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-combining-data-tables-768x504.png 768w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-combining-data-tables-380x249.png 380w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-combining-data-tables-700x459.png 700w, https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2021\/10\/what-is-sql-and-how-does-it-work-combining-data-tables-380x249.png 420w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Source: <a href=\"https:\/\/www.dataschool.io\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.dataschool.io\/\" rel=\"noreferrer noopener\">DataSchool<\/a><\/figcaption><\/figure>\n\n\n\n<p>A Right Join works exactly like a Left Join, with the only distinction being in the base table. In the Left Join, table 1 (left table) was considered to be the base, whereas, in the Right Join, table 2 (right table) will be considered as a base.  A Right Join combines the columns on a common dimension (the first N columns) when possible, returning all rows from the second\/right table with the matching rows in the first\/left table.<\/p>\n\n\n\n<p>Seems complicated? It really isn&#8217;t when you start joining the tables in real-time data. SQL being as simple as it is, it can be integrated &amp; used within multiple languages like R, Python, Scala, and Hadoop. This makes data science &amp; big data management an easy-breezy tasks to do!&nbsp;&nbsp;<\/p>\n\n\n\n<p>In this blog, we have summarized what is SQL and how does it work, but there is a lot more to learn in it to become an expert (here is a <a href=\"https:\/\/www.springboard.com\/blog\/data-analytics\/sql-certifications\/\" target=\"_blank\" rel=\"noreferrer noopener\">blog listing the top 10 best SQL certifications to grow your skillset<\/a>). SQL is a must-have skill for any <a href=\"https:\/\/www.springboard.com\/blog\/data-analytics\/what-is-data-analytics\/\" data-type=\"URL\" data-id=\"https:\/\/www.springboard.com\/blog\/data-analytics\/what-is-data-analytics\/\">data analytics<\/a> or data science professionals. This is, in fact, a very commonly covered topic in <a href=\"https:\/\/www.springboard.com\/blog\/data-analytics\/data-analyst-interview-questions-answers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Data Analytics Interviews<\/a>. In a world where data is the new oil, finding out what is SQL and how does it work, and understanding what is SQL used for can take you a long way ahead. <\/p>\n\n\n\n<p>Here is a post with detailed 105 most asked <a href=\"https:\/\/www.springboard.com\/blog\/data-analytics\/sql-interview-questions\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQL interview questions<\/a> along with the best ways to answer them. <\/p>\n\n\n\n<p>To learn this and much more, join Springboard\u2019s <a href=\"https:\/\/www.springboard.com\/courses\/data-analytics-career-track\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"text-decoration: underline;\">Data Analytics Career Track<\/span> <\/a>program. With 1:1 mentoring-led, project-driven approach, detailed curriculum, and real-life examples, you will become an expert at SQL &amp; data analytics in 6 months! Also, did we mention that the career track program offers a job guarantee? Apply Now!<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#efeff6\"><strong>Since you&#8217;re here&#8230;<br><\/strong>Switching to a career in data analytics is possible, no matter your background. We\u2019ve helped <a href=\"https:\/\/www.springboard.com\/success\/\" target=\"_blank\" rel=\"noreferrer noopener\">over 10,000 students <\/a>make it happen. Check out our <a href=\"https:\/\/www.springboard.com\/resources\/learning-paths\/data-analysis\/\" target=\"_blank\" rel=\"noreferrer noopener\">free data analytics curriculum<\/a> to gauge your interest, or go all-in with our <a href=\"https:\/\/www.springboard.com\/courses\/data-analytics-career-track\/\" target=\"_blank\" rel=\"noreferrer noopener\">Data Analytics Bootcamp<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL or Structured Query Language is a critical tool for data professionals. It is undoubtedly the most important language for getting a job in the field of data analysis or data sciences. Millions of data points are being generated every minute and raw data does not have any story to tell. After all this data [&hellip;]<\/p>\n","protected":false},"author":100,"featured_media":3767,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_eb_attr":"","_eb_data_table":"","footnotes":""},"categories":[134],"tags":[],"marketing_tags":[1476],"class_list":{"0":"post-12770","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-analytics"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/posts\/12770"}],"collection":[{"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/comments?post=12770"}],"version-history":[{"count":4,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/posts\/12770\/revisions"}],"predecessor-version":[{"id":49308,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/posts\/12770\/revisions\/49308"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/media\/3767"}],"wp:attachment":[{"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/media?parent=12770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/categories?post=12770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/tags?post=12770"},{"taxonomy":"marketing_tags","embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/marketing_tags?post=12770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}