{"id":7262,"date":"2023-08-21T09:14:54","date_gmt":"2023-08-21T17:14:54","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=7262"},"modified":"2025-04-24T17:14:39","modified_gmt":"2025-04-24T17:14:39","slug":"sql-for-data-science","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/","title":{"rendered":"SQL for Data Science"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\">\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<p id=\"b991\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Data Science is the most rapidly growing field, with tons of job openings. One must be familiar with SQL in order to work as a Data Scientist. While Machine Learning and AI now dominate the fields of Data Science, SQL, which is nearly 50 years old, remains one of the most important skills.<\/p>\n<p id=\"e119\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">SQL is easily the <a class=\"af mr\" href=\"https:\/\/insights.stackoverflow.com\/survey\/2020#technology-databases-all-respondents4\" target=\"_blank\" rel=\"noopener ugc nofollow\"><strong class=\"be ms\">most widely used language<\/strong><\/a> in the world, and as long as there is \u2018data\u2019 in data science, Structured Query Language (or see-quel as we call it) will continue to play a significant role. To analyze the data, we must first extract it from the database. This is where SQL comes into play. To train your model, you must have clean data, therefore SQL is not only a tool for machine learning.<\/p>\n<p id=\"75dd\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">This blog post on SQL for Data Science will teach you how to use SQL to store, access, and retrieve data for data analysis. SQL is a language for querying or retrieving data from relational databases.<\/p>\n<h1 id=\"0f25\" class=\"mt mu fo be mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq bj\" data-selectable-paragraph=\"\">Where does SQL fit in when it comes to Data Science?<\/h1>\n<p id=\"0557\" class=\"pw-post-body-paragraph lu lv fo be b lw nr ly lz ma ns mc md me nt mg mh mi nu mk ml mm nv mo mp mq fh bj\" data-selectable-paragraph=\"\">Data Science involves data gathering, analysis, retrieval, and storage. Dealing with massive volumes of data is <a class=\"af mr\" href=\"https:\/\/go.comet.ml\/rs\/912-JJP-445\/images\/Comet_Report-2021_ML_Practitioner_Survey.pdf\" target=\"_blank\" rel=\"noopener ugc nofollow\">one of the most pressing challenges for data scientists<\/a>. This is especially true in today\u2019s environment, when huge volumes of data are available in almost every subject. Netflix, for example, recommends what you should watch next based on your recent viewing habits. Similarly, when you search for anything on Google, it gives results with goods or products that are comparable. Data storage and intelligent application make this feasible.<\/p>\n<h1 id=\"3e31\" class=\"mt mu fo be mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq bj\" data-selectable-paragraph=\"\">Why is SQL crucial for Data Science?<\/h1>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*8BlbKFF_4jh7J7zz.png\" alt=\"\" width=\"700\" height=\"394\"><\/figure><div class=\"nw nx ny\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/0*8BlbKFF_4jh7J7zz.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/0*8BlbKFF_4jh7J7zz.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/0*8BlbKFF_4jh7J7zz.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/0*8BlbKFF_4jh7J7zz.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/0*8BlbKFF_4jh7J7zz.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/0*8BlbKFF_4jh7J7zz.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/0*8BlbKFF_4jh7J7zz.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*8BlbKFF_4jh7J7zz.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*8BlbKFF_4jh7J7zz.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*8BlbKFF_4jh7J7zz.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*8BlbKFF_4jh7J7zz.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*8BlbKFF_4jh7J7zz.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*8BlbKFF_4jh7J7zz.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*8BlbKFF_4jh7J7zz.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div><figcaption class=\"ol om on nw nx oo op be b bf z dv\" data-selectable-paragraph=\"\">Demand of SQL ( <a class=\"af mr\" href=\"https:\/\/insights.stackoverflow.com\/survey\/2020#technology-databases-all-respondents4\" target=\"_blank\" rel=\"noopener ugc nofollow\">https:\/\/insights.stackoverflow.com\/survey\/2020#technology-databases-all-respondents4<\/a> )<\/figcaption><\/figure>\n<h2 id=\"5679\" class=\"oq mu fo be mv or os ot mz ou ov ow nd me ox oy oz mi pa pb pc mm pd pe pf pg bj\" data-selectable-paragraph=\"\">Easy to Learn and Use<\/h2>\n<p id=\"6d35\" class=\"pw-post-body-paragraph lu lv fo be b lw nr ly lz ma ns mc md me nt mg mh mi nu mk ml mm nv mo mp mq fh bj\" data-selectable-paragraph=\"\">Since it uses words from the English language in its simple syntax, SQL is always praised for its simplicity. Unlike some other sophisticated programming languages that demand a lot more effort and mental understanding, it makes it easier for you to understand the principles.<\/p>\n<p id=\"d399\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">SQL is the ideal place for you to start if you are new to the discipline of data science. With just a few lines of code, you can quickly query and change your data to draw insights from it.<\/p>\n<h2 id=\"31dd\" class=\"oq mu fo be mv or os ot mz ou ov ow nd me ox oy oz mi pa pb pc mm pd pe pf pg bj\" data-selectable-paragraph=\"\">Understanding your Data<\/h2>\n<p id=\"1334\" class=\"pw-post-body-paragraph lu lv fo be b lw nr ly lz ma ns mc md me nt mg mh mi nu mk ml mm nv mo mp mq fh bj\" data-selectable-paragraph=\"\">The core component of data science is data. You need to be able to draw out the true meaning from your data in order to perform data science, and SQL can help you with that.<\/p>\n<p id=\"8451\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">You may efficiently examine and display your dataset with SQL for Data Science to generate reliable results. It will assist you in dealing with outliers, missing and null values, and other data abnormalities.<\/p>\n<h2 id=\"5bd8\" class=\"oq mu fo be mv or os ot mz ou ov ow nd me ox oy oz mi pa pb pc mm pd pe pf pg bj\" data-selectable-paragraph=\"\">SQL Integrates with Scripting Languages<\/h2>\n<p id=\"7a8d\" class=\"pw-post-body-paragraph lu lv fo be b lw nr ly lz ma ns mc md me nt mg mh mi nu mk ml mm nv mo mp mq fh bj\" data-selectable-paragraph=\"\">As a Data Scientist, you will occasionally have to communicate your findings to the other team members of the business when working on a project. It should be possible to understand the explanation with ease.<\/p>\n<p id=\"925d\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">In these circumstances, SQL for Data Science can be of assistance because it interfaces well with the most popular scripting languages, like Python and R programming. You can link the client application with your database using some SQL libraries, such as SQLite, MySQLdb, etc. It eases the process of development a little.<\/p>\n<h2 id=\"7b18\" class=\"oq mu fo be mv or os ot mz ou ov ow nd me ox oy oz mi pa pb pc mm pd pe pf pg bj\" data-selectable-paragraph=\"\">Manage Large Volumes of Data<\/h2>\n<p id=\"546a\" class=\"pw-post-body-paragraph lu lv fo be b lw nr ly lz ma ns mc md me nt mg mh mi nu mk ml mm nv mo mp mq fh bj\" data-selectable-paragraph=\"\">Massive amounts of data must be gathered and managed in databases in order to conduct data science. However, handling such massive volumes of data with spreadsheets gets tiresome. As a result, SQL gives you the right tools for managing such massive amounts of data and drawing conclusions from it.<\/p>\n<h1 id=\"9db7\" class=\"mt mu fo be mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq bj\" data-selectable-paragraph=\"\">SQL\u2019s Processing Capabilities<\/h1>\n<p id=\"96aa\" class=\"pw-post-body-paragraph lu lv fo be b lw nr ly lz ma ns mc md me nt mg mh mi nu mk ml mm nv mo mp mq fh bj\" data-selectable-paragraph=\"\">SQL has the following processing capabilities:<\/p>\n<p id=\"34cc\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">1. <strong class=\"be ms\">Data Definition Language (DDL):<\/strong> The SQL DDL includes instructions for building indexes, defining relation schemas, and changing relation schemas.<\/p>\n<p id=\"1a68\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">2. <strong class=\"be ms\">Data Manipulation Language (DML):<\/strong> The SQL DML has a query language that is based on both relational algebra and tuple relational calculus. It also has instructions for inserting, deleting, and modifying tuples in the database.<\/p>\n<p id=\"116a\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">3. <strong class=\"be ms\">View Definition:<\/strong> View definition commands are also included in the SQL DDL.<\/p>\n<p id=\"bedc\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">4. <strong class=\"be ms\">Authorization:<\/strong> SQL DDL instructions for defining access rights to relations and views are included.<\/p>\n<p id=\"40df\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">5. <strong class=\"be ms\">Integrity: <\/strong>The SQL language supports (limited) kinds of integrity verification. SQL products and standards in the future are anticipated to have greater integrity checking capabilities.<\/p>\n<p id=\"8e1c\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Now we can go through some of the SQL commands to know it better.<\/p>\n<ol class=\"\">\n<li id=\"cf22\" class=\"lu lv fo be b lw lx ly lz ma mb mc md ph mf mg mh pi mj mk ml pj mn mo mp mq pk pl pm bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">CREATE TABLE command<\/strong>: The CREATE TABLE command is used to create tables. Columns are named and data types and sizes are specified for each column when a table is constructed. There is at least one column in each table. The syntax of the CREATE TABLE command is as follows:<\/li>\n<\/ol>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*zYLXv9ApETGGK98j\" alt=\"\" width=\"700\" height=\"195\"><\/figure><div class=\"nw nx pn\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*zYLXv9ApETGGK98j 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*zYLXv9ApETGGK98j 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*zYLXv9ApETGGK98j 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*zYLXv9ApETGGK98j 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*zYLXv9ApETGGK98j 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*zYLXv9ApETGGK98j 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*zYLXv9ApETGGK98j 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*zYLXv9ApETGGK98j 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*zYLXv9ApETGGK98j 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*zYLXv9ApETGGK98j 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*zYLXv9ApETGGK98j 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*zYLXv9ApETGGK98j 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*zYLXv9ApETGGK98j 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*zYLXv9ApETGGK98j 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"d117\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">You can also create a table using another table. Refer the below syntax and example:<\/p>\n<p id=\"f5c5\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">The \u2018<strong class=\"be ms\">CREATE TABLE AS\u2019<\/strong> Statement<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*6zz4YprWJlTt7dT8\" alt=\"\" width=\"700\" height=\"124\"><\/figure><div class=\"nw nx pn\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*6zz4YprWJlTt7dT8 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*6zz4YprWJlTt7dT8 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*6zz4YprWJlTt7dT8 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*6zz4YprWJlTt7dT8 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*6zz4YprWJlTt7dT8 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*6zz4YprWJlTt7dT8 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*6zz4YprWJlTt7dT8 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*6zz4YprWJlTt7dT8 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*6zz4YprWJlTt7dT8 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*6zz4YprWJlTt7dT8 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*6zz4YprWJlTt7dT8 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*6zz4YprWJlTt7dT8 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*6zz4YprWJlTt7dT8 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*6zz4YprWJlTt7dT8 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"865c\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">2. SELECT FROM<\/strong>: The most basic example of retrieval is getting all of the material from a specified database table. If we wanted to know all of the film categories in the \u2018Category\u2019 table, we might use the following command:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:320\/0*uBDag4jiJy69HgKv\" alt=\"\" width=\"523\" height=\"337\"><\/figure><div class=\"nw nx po\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*uBDag4jiJy69HgKv 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*uBDag4jiJy69HgKv 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*uBDag4jiJy69HgKv 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*uBDag4jiJy69HgKv 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*uBDag4jiJy69HgKv 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*uBDag4jiJy69HgKv 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*uBDag4jiJy69HgKv 640w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 320px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*uBDag4jiJy69HgKv 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*uBDag4jiJy69HgKv 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*uBDag4jiJy69HgKv 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*uBDag4jiJy69HgKv 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*uBDag4jiJy69HgKv 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*uBDag4jiJy69HgKv 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*uBDag4jiJy69HgKv 640w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 320px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"6822\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">Output:<\/strong><\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:527\/0*gJtOznCYZQDFzvPF\" alt=\"\" width=\"527\" height=\"285\"><\/figure><div class=\"nw nx pp\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*gJtOznCYZQDFzvPF 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*gJtOznCYZQDFzvPF 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*gJtOznCYZQDFzvPF 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*gJtOznCYZQDFzvPF 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*gJtOznCYZQDFzvPF 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*gJtOznCYZQDFzvPF 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1054\/0*gJtOznCYZQDFzvPF 1054w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 527px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*gJtOznCYZQDFzvPF 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*gJtOznCYZQDFzvPF 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*gJtOznCYZQDFzvPF 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*gJtOznCYZQDFzvPF 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*gJtOznCYZQDFzvPF 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*gJtOznCYZQDFzvPF 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1054\/0*gJtOznCYZQDFzvPF 1054w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 527px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"3b52\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">3. DISTINCT:<\/strong> In some cases, we are only interested in knowing unique values. What if we want to know all of the MPAA ratings from the film table? Using DISTINCT, we can select only unique values:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:320\/0*AbzdTLGWFn_gKo8z\" alt=\"\" width=\"437\" height=\"307\"><\/figure><div class=\"nw nx po\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*AbzdTLGWFn_gKo8z 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*AbzdTLGWFn_gKo8z 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*AbzdTLGWFn_gKo8z 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*AbzdTLGWFn_gKo8z 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*AbzdTLGWFn_gKo8z 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*AbzdTLGWFn_gKo8z 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*AbzdTLGWFn_gKo8z 640w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 320px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*AbzdTLGWFn_gKo8z 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*AbzdTLGWFn_gKo8z 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*AbzdTLGWFn_gKo8z 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*AbzdTLGWFn_gKo8z 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*AbzdTLGWFn_gKo8z 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*AbzdTLGWFn_gKo8z 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*AbzdTLGWFn_gKo8z 640w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 320px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"88c1\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">Result:<\/strong><\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:158\/0*N58FLFmpfCq4ywsR\" alt=\"\" width=\"443\" height=\"450\"><\/figure><div class=\"nw nx pq\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*N58FLFmpfCq4ywsR 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*N58FLFmpfCq4ywsR 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*N58FLFmpfCq4ywsR 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*N58FLFmpfCq4ywsR 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*N58FLFmpfCq4ywsR 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*N58FLFmpfCq4ywsR 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:316\/0*N58FLFmpfCq4ywsR 316w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 158px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*N58FLFmpfCq4ywsR 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*N58FLFmpfCq4ywsR 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*N58FLFmpfCq4ywsR 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*N58FLFmpfCq4ywsR 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*N58FLFmpfCq4ywsR 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*N58FLFmpfCq4ywsR 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:316\/0*N58FLFmpfCq4ywsR 316w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 158px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<h2 id=\"1228\" class=\"oq mu fo be mv or os ot mz ou ov ow nd me ox oy oz mi pa pb pc mm pd pe pf pg bj\" data-selectable-paragraph=\"\">Data Retrieval<\/h2>\n<ol class=\"\">\n<li id=\"6063\" class=\"lu lv fo be b lw nr ly lz ma ns mc md ph nt mg mh pi nu mk ml pj nv mo mp mq pk pl pm bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">WHERE: <\/strong>There are times when we only want to retrieve specific entries that meet certain criteria. Using the WHERE clause, we can specify conditions that must be met before returning the data. Essentially, we are filtering entries based on the condition. What if we only want to know about movies that are rated PG-13?<\/li>\n<\/ol>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:667\/0*PGKqfiA41JIb7YsG\" alt=\"\" width=\"667\" height=\"188\"><\/figure><div class=\"nw nx pr\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*PGKqfiA41JIb7YsG 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*PGKqfiA41JIb7YsG 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*PGKqfiA41JIb7YsG 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*PGKqfiA41JIb7YsG 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*PGKqfiA41JIb7YsG 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*PGKqfiA41JIb7YsG 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1334\/0*PGKqfiA41JIb7YsG 1334w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 667px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*PGKqfiA41JIb7YsG 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*PGKqfiA41JIb7YsG 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*PGKqfiA41JIb7YsG 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*PGKqfiA41JIb7YsG 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*PGKqfiA41JIb7YsG 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*PGKqfiA41JIb7YsG 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1334\/0*PGKqfiA41JIb7YsG 1334w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 667px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"2736\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Result:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:452\/0*JIqeib4ESsDXsGMj\" alt=\"\" width=\"452\" height=\"582\"><\/figure><div class=\"nw nx ps\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*JIqeib4ESsDXsGMj 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*JIqeib4ESsDXsGMj 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*JIqeib4ESsDXsGMj 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*JIqeib4ESsDXsGMj 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*JIqeib4ESsDXsGMj 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*JIqeib4ESsDXsGMj 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:904\/0*JIqeib4ESsDXsGMj 904w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 452px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*JIqeib4ESsDXsGMj 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*JIqeib4ESsDXsGMj 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*JIqeib4ESsDXsGMj 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*JIqeib4ESsDXsGMj 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*JIqeib4ESsDXsGMj 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*JIqeib4ESsDXsGMj 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:904\/0*JIqeib4ESsDXsGMj 904w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 452px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"ede9\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Furthermore, we can compile a list of movies with rental ratings of 4.5 or higher:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:667\/0*MHbFkeXqQYhYRRGH\" alt=\"\" width=\"667\" height=\"188\"><\/figure><div class=\"nw nx pr\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*MHbFkeXqQYhYRRGH 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*MHbFkeXqQYhYRRGH 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*MHbFkeXqQYhYRRGH 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*MHbFkeXqQYhYRRGH 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*MHbFkeXqQYhYRRGH 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*MHbFkeXqQYhYRRGH 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1334\/0*MHbFkeXqQYhYRRGH 1334w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 667px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*MHbFkeXqQYhYRRGH 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*MHbFkeXqQYhYRRGH 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*MHbFkeXqQYhYRRGH 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*MHbFkeXqQYhYRRGH 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*MHbFkeXqQYhYRRGH 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*MHbFkeXqQYhYRRGH 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1334\/0*MHbFkeXqQYhYRRGH 1334w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 667px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"a1c6\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">2. ORDER BY: <\/strong>We may sometimes better understand the data by sorting the returned result. What if we wanted the same list as before, but with PG-13 films arranged in length order from longest to shortest, and vice versa? With ORDER BY, this is simple to do:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*g9-Dv7WdSFQyiJKj\" alt=\"\" width=\"700\" height=\"173\"><\/figure><div class=\"nw nx pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*g9-Dv7WdSFQyiJKj 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*g9-Dv7WdSFQyiJKj 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*g9-Dv7WdSFQyiJKj 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*g9-Dv7WdSFQyiJKj 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*g9-Dv7WdSFQyiJKj 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*g9-Dv7WdSFQyiJKj 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*g9-Dv7WdSFQyiJKj 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*g9-Dv7WdSFQyiJKj 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*g9-Dv7WdSFQyiJKj 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*g9-Dv7WdSFQyiJKj 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*g9-Dv7WdSFQyiJKj 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*g9-Dv7WdSFQyiJKj 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*g9-Dv7WdSFQyiJKj 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*g9-Dv7WdSFQyiJKj 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"b3fa\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Result:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:620\/0*R-7XLBhEHGOh208f\" alt=\"\" width=\"620\" height=\"580\"><\/figure><div class=\"nw nx pu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*R-7XLBhEHGOh208f 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*R-7XLBhEHGOh208f 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*R-7XLBhEHGOh208f 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*R-7XLBhEHGOh208f 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*R-7XLBhEHGOh208f 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*R-7XLBhEHGOh208f 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1240\/0*R-7XLBhEHGOh208f 1240w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 620px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*R-7XLBhEHGOh208f 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*R-7XLBhEHGOh208f 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*R-7XLBhEHGOh208f 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*R-7XLBhEHGOh208f 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*R-7XLBhEHGOh208f 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*R-7XLBhEHGOh208f 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1240\/0*R-7XLBhEHGOh208f 1240w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 620px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"d6c6\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">3. LIMIT:<\/strong> Furthermore, there are instances when we are only interested in a small number of submissions. Here, we actually only care about the ten PG-13 movies with the longest runtimes, so we can utilize the LIMIT clause.<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*clk5ou6BK4zNNR-x\" alt=\"\" width=\"700\" height=\"220\"><\/figure><div class=\"nw nx pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*clk5ou6BK4zNNR-x 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*clk5ou6BK4zNNR-x 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*clk5ou6BK4zNNR-x 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*clk5ou6BK4zNNR-x 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*clk5ou6BK4zNNR-x 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*clk5ou6BK4zNNR-x 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*clk5ou6BK4zNNR-x 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*clk5ou6BK4zNNR-x 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*clk5ou6BK4zNNR-x 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*clk5ou6BK4zNNR-x 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*clk5ou6BK4zNNR-x 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*clk5ou6BK4zNNR-x 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*clk5ou6BK4zNNR-x 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*clk5ou6BK4zNNR-x 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"bde6\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Return:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:607\/0*SvEG5aw6lORHEFE8\" alt=\"\" width=\"607\" height=\"328\"><\/figure><div class=\"nw nx pv\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*SvEG5aw6lORHEFE8 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*SvEG5aw6lORHEFE8 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*SvEG5aw6lORHEFE8 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*SvEG5aw6lORHEFE8 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*SvEG5aw6lORHEFE8 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*SvEG5aw6lORHEFE8 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1214\/0*SvEG5aw6lORHEFE8 1214w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 607px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*SvEG5aw6lORHEFE8 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*SvEG5aw6lORHEFE8 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*SvEG5aw6lORHEFE8 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*SvEG5aw6lORHEFE8 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*SvEG5aw6lORHEFE8 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*SvEG5aw6lORHEFE8 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1214\/0*SvEG5aw6lORHEFE8 1214w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 607px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<blockquote class=\"qe\"><p id=\"33ce\" class=\"qf qg fo be qh qi qj qk ql qm qn mq dv\" data-selectable-paragraph=\"\">What tips do big name companies have for students and start ups? We asked them! <a class=\"af mr\" href=\"https:\/\/www.comet.com\/site\/blog\/industry-qa-where-most-machine-learning-projects-fail\/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_CTA\" target=\"_blank\" rel=\"noopener ugc nofollow\">Read or watch our industry Q&amp;A for advice from teams at Stanford, Google, and HuggingFace.<\/a><\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fh fi fj fk fl\">\n<div class=\"ab ca\">\n<div class=\"ch bg et eu ev ew\">\n<h1 id=\"1ccf\" class=\"mt mu fo be mv mw qo my mz na qp nc nd ne qq ng nh ni qr nk nl nm qs no np nq bj\" data-selectable-paragraph=\"\">Aggregations:<\/h1>\n<ul class=\"\">\n<li id=\"eede\" class=\"lu lv fo be b lw nr ly lz ma ns mc md ph nt mg mh pi nu mk ml pj nv mo mp mq qt pl pm bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">GROUP BY &amp; COUNT( ):<\/strong> In order to get insights, aggregates are frequently utilized to obtain a summary of the dataset. The GROUP BY clause is frequently used with aggregates. For instance, if we want to know how many rentals each client has already leased, we may count the rentals and sort the results by how many rentals each customer has thus far.<\/li>\n<\/ul>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*m8uAeAbWlWwc-12U\" alt=\"\" width=\"700\" height=\"204\"><\/figure><div class=\"nw nx pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*m8uAeAbWlWwc-12U 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*m8uAeAbWlWwc-12U 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*m8uAeAbWlWwc-12U 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*m8uAeAbWlWwc-12U 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*m8uAeAbWlWwc-12U 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*m8uAeAbWlWwc-12U 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*m8uAeAbWlWwc-12U 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*m8uAeAbWlWwc-12U 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*m8uAeAbWlWwc-12U 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*m8uAeAbWlWwc-12U 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*m8uAeAbWlWwc-12U 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*m8uAeAbWlWwc-12U 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*m8uAeAbWlWwc-12U 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*m8uAeAbWlWwc-12U 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"991d\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Results:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:459\/0*5l6b9gvuXo4f-Yum\" alt=\"\" width=\"459\" height=\"331\"><\/figure><div class=\"nw nx qu\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*5l6b9gvuXo4f-Yum 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*5l6b9gvuXo4f-Yum 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*5l6b9gvuXo4f-Yum 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*5l6b9gvuXo4f-Yum 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*5l6b9gvuXo4f-Yum 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*5l6b9gvuXo4f-Yum 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:918\/0*5l6b9gvuXo4f-Yum 918w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 459px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*5l6b9gvuXo4f-Yum 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*5l6b9gvuXo4f-Yum 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*5l6b9gvuXo4f-Yum 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*5l6b9gvuXo4f-Yum 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*5l6b9gvuXo4f-Yum 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*5l6b9gvuXo4f-Yum 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:918\/0*5l6b9gvuXo4f-Yum 918w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 459px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<ul class=\"\">\n<li id=\"078b\" class=\"lu lv fo be b lw lx ly lz ma mb mc md ph mf mg mh pi mj mk ml pj mn mo mp mq qt pl pm bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">SUM( ): <\/strong>Consider the amount of money each consumer has spent. This may be done by using the SUM aggregator function. In this case, we want the biggest spender to be at the top.<\/li>\n<\/ul>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*f09Haxzlpm0miKaP\" alt=\"\" width=\"700\" height=\"204\"><\/figure><div class=\"nw nx pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*f09Haxzlpm0miKaP 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*f09Haxzlpm0miKaP 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*f09Haxzlpm0miKaP 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*f09Haxzlpm0miKaP 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*f09Haxzlpm0miKaP 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*f09Haxzlpm0miKaP 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*f09Haxzlpm0miKaP 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*f09Haxzlpm0miKaP 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*f09Haxzlpm0miKaP 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*f09Haxzlpm0miKaP 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*f09Haxzlpm0miKaP 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*f09Haxzlpm0miKaP 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*f09Haxzlpm0miKaP 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*f09Haxzlpm0miKaP 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"69bf\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Result:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:486\/0*4LcIuPEGByYpd4Ls\" alt=\"\" width=\"486\" height=\"331\"><\/figure><div class=\"nw nx qv\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*4LcIuPEGByYpd4Ls 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*4LcIuPEGByYpd4Ls 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*4LcIuPEGByYpd4Ls 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*4LcIuPEGByYpd4Ls 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*4LcIuPEGByYpd4Ls 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*4LcIuPEGByYpd4Ls 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:972\/0*4LcIuPEGByYpd4Ls 972w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 486px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*4LcIuPEGByYpd4Ls 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*4LcIuPEGByYpd4Ls 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*4LcIuPEGByYpd4Ls 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*4LcIuPEGByYpd4Ls 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*4LcIuPEGByYpd4Ls 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*4LcIuPEGByYpd4Ls 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:972\/0*4LcIuPEGByYpd4Ls 972w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 486px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<ul class=\"\">\n<li id=\"b52f\" class=\"lu lv fo be b lw lx ly lz ma mb mc md ph mf mg mh pi mj mk ml pj mn mo mp mq qt pl pm bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">AVG( ) &amp; HAVING: <\/strong>After you have produced a grouped aggregate, we may add further conditions by using the HAVING operator. For instance, what MAAP rating categories, on average, contain films that are longer than 115 minutes?<\/li>\n<\/ul>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*JVexxYUJhGsz2n_v\" alt=\"\" width=\"700\" height=\"204\"><\/figure><div class=\"nw nx pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*JVexxYUJhGsz2n_v 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*JVexxYUJhGsz2n_v 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*JVexxYUJhGsz2n_v 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*JVexxYUJhGsz2n_v 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*JVexxYUJhGsz2n_v 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*JVexxYUJhGsz2n_v 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*JVexxYUJhGsz2n_v 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*JVexxYUJhGsz2n_v 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*JVexxYUJhGsz2n_v 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*JVexxYUJhGsz2n_v 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*JVexxYUJhGsz2n_v 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*JVexxYUJhGsz2n_v 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*JVexxYUJhGsz2n_v 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*JVexxYUJhGsz2n_v 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"7c6b\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Result:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:571\/0*pNtkOYjJWv8iaplr\" alt=\"\" width=\"571\" height=\"184\"><\/figure><div class=\"nw nx qw\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*pNtkOYjJWv8iaplr 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*pNtkOYjJWv8iaplr 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*pNtkOYjJWv8iaplr 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*pNtkOYjJWv8iaplr 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*pNtkOYjJWv8iaplr 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*pNtkOYjJWv8iaplr 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1142\/0*pNtkOYjJWv8iaplr 1142w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 571px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*pNtkOYjJWv8iaplr 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*pNtkOYjJWv8iaplr 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*pNtkOYjJWv8iaplr 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*pNtkOYjJWv8iaplr 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*pNtkOYjJWv8iaplr 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*pNtkOYjJWv8iaplr 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1142\/0*pNtkOYjJWv8iaplr 1142w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 571px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<h1 id=\"c336\" class=\"mt mu fo be mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq bj\" data-selectable-paragraph=\"\">Joins<\/h1>\n<ul class=\"\">\n<li id=\"9e72\" class=\"lu lv fo be b lw nr ly lz ma ns mc md ph nt mg mh pi nu mk ml pj nv mo mp mq qt pl pm bj\" data-selectable-paragraph=\"\"><strong class=\"be ms\">INNER JOIN (JOIN): <\/strong>You\u2019ve undoubtedly observed that we can only accomplish so much with a single table, given the limitations. We frequently wish to examine the data from several tables. JOINs are used in this situation. On the basis of a shared key, we may link tables. For instance, suppose we wanted to find movies that weren\u2019t in English:<\/li>\n<\/ul>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*Se0nUVqIlWLWuQyX\" alt=\"\" width=\"700\" height=\"220\"><\/figure><div class=\"nw nx pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*Se0nUVqIlWLWuQyX 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*Se0nUVqIlWLWuQyX 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*Se0nUVqIlWLWuQyX 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*Se0nUVqIlWLWuQyX 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*Se0nUVqIlWLWuQyX 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*Se0nUVqIlWLWuQyX 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*Se0nUVqIlWLWuQyX 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*Se0nUVqIlWLWuQyX 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*Se0nUVqIlWLWuQyX 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*Se0nUVqIlWLWuQyX 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*Se0nUVqIlWLWuQyX 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*Se0nUVqIlWLWuQyX 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*Se0nUVqIlWLWuQyX 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*Se0nUVqIlWLWuQyX 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"8cc3\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">(Please take note that this database only contains English-language films. With the query mentioned above, you will receive an empty table.)<\/p>\n<p id=\"dad8\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Additionally, you may join several tables. For instance, the categories and accompanying average rating are listed below. In addition, we have returned numbers in ascending order of average rating.<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<div class=\"of og eb oh bg oi\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*s4QDx5IrKaXyoXz_\" alt=\"\" width=\"700\" height=\"267\"><\/figure><div class=\"nw nx pt\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*s4QDx5IrKaXyoXz_ 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*s4QDx5IrKaXyoXz_ 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*s4QDx5IrKaXyoXz_ 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*s4QDx5IrKaXyoXz_ 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*s4QDx5IrKaXyoXz_ 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*s4QDx5IrKaXyoXz_ 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*s4QDx5IrKaXyoXz_ 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*s4QDx5IrKaXyoXz_ 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*s4QDx5IrKaXyoXz_ 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*s4QDx5IrKaXyoXz_ 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*s4QDx5IrKaXyoXz_ 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*s4QDx5IrKaXyoXz_ 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*s4QDx5IrKaXyoXz_ 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/0*s4QDx5IrKaXyoXz_ 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<\/figure>\n<p id=\"562b\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">Returns:<\/p>\n<figure class=\"nz oa ob oc od oe nw nx paragraph-image\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg oj ok c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:665\/0*hY8F7-PNNddrDtxh\" alt=\"\" width=\"665\" height=\"579\"><\/figure><div class=\"nw nx qx\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*hY8F7-PNNddrDtxh 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*hY8F7-PNNddrDtxh 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*hY8F7-PNNddrDtxh 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*hY8F7-PNNddrDtxh 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*hY8F7-PNNddrDtxh 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*hY8F7-PNNddrDtxh 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1330\/0*hY8F7-PNNddrDtxh 1330w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 665px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/0*hY8F7-PNNddrDtxh 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/0*hY8F7-PNNddrDtxh 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/0*hY8F7-PNNddrDtxh 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/0*hY8F7-PNNddrDtxh 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/0*hY8F7-PNNddrDtxh 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/0*hY8F7-PNNddrDtxh 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1330\/0*hY8F7-PNNddrDtxh 1330w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 665px\" data-testid=\"og\"><\/picture><\/div>\n<\/figure>\n<p id=\"4bbf\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">There are many types of joins: INNER JOIN, LEFT JOIN, RIGHT JOIN, OUTER JOIN, CROSS JOIN. Here, we used JOIN, which by default is an INNER JOIN in which you get back entries only if they are present in both tables.<\/p>\n<p id=\"4dff\" class=\"pw-post-body-paragraph lu lv fo be b lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq fh bj\" data-selectable-paragraph=\"\">You may look at the <a class=\"af mr\" href=\"https:\/\/www.w3schools.com\/sql\/sql_join.asp#:~:text=Different%20Types%20of%20SQL%20JOINs&amp;text=(INNER)%20JOIN%20%3A%20Returns%20records,records%20from%20the%20left%20table\" target=\"_blank\" rel=\"noopener ugc nofollow\">Joining Data in SQL<\/a> course if you want to understand more about the variations between these joins.<\/p>\n<h1 id=\"e2d8\" class=\"mt mu fo be mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq bj\" data-selectable-paragraph=\"\"><strong class=\"al\">Conclusion<\/strong><\/h1>\n<p id=\"959e\" class=\"pw-post-body-paragraph lu lv fo be b lw nr ly lz ma ns mc md me nt mg mh mi nu mk ml mm nv mo mp mq fh bj\" data-selectable-paragraph=\"\">We looked through all of the instructions that will let you plan your own SQL track in this tutorial. This article addressed all commands, from the fundamentals to the advanced. If you enjoy my writing style, please follow me on Medium.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Data Science is the most rapidly growing field, with tons of job openings. One must be familiar with SQL in order to work as a Data Scientist. While Machine Learning and AI now dominate the fields of Data Science, SQL, which is nearly 50 years old, remains one of the most important skills. SQL is [&hellip;]<\/p>\n","protected":false},"author":78,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"categories":[6],"tags":[],"coauthors":[175],"class_list":["post-7262","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL for Data Science - Comet<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL for Data Science\" \/>\n<meta property=\"og:description\" content=\"Data Science is the most rapidly growing field, with tons of job openings. One must be familiar with SQL in order to work as a Data Scientist. While Machine Learning and AI now dominate the fields of Data Science, SQL, which is nearly 50 years old, remains one of the most important skills. SQL is [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-21T17:14:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:14:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*8BlbKFF_4jh7J7zz.png\" \/>\n<meta name=\"author\" content=\"Anoop Painuly\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anoop Painuly\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL for Data Science - Comet","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:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/","og_locale":"en_US","og_type":"article","og_title":"SQL for Data Science","og_description":"Data Science is the most rapidly growing field, with tons of job openings. One must be familiar with SQL in order to work as a Data Scientist. While Machine Learning and AI now dominate the fields of Data Science, SQL, which is nearly 50 years old, remains one of the most important skills. SQL is [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-08-21T17:14:54+00:00","article_modified_time":"2025-04-24T17:14:39+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*8BlbKFF_4jh7J7zz.png","type":"","width":"","height":""}],"author":"Anoop Painuly","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Anoop Painuly","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/"},"author":{"name":"Anoop Painuly","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/789020ef94f9a6d9e9c44a18fc1ab67a"},"headline":"SQL for Data Science","datePublished":"2023-08-21T17:14:54+00:00","dateModified":"2025-04-24T17:14:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/"},"wordCount":1398,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*8BlbKFF_4jh7J7zz.png","articleSection":["Machine Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/","url":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/","name":"SQL for Data Science - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*8BlbKFF_4jh7J7zz.png","datePublished":"2023-08-21T17:14:54+00:00","dateModified":"2025-04-24T17:14:39+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*8BlbKFF_4jh7J7zz.png","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/0*8BlbKFF_4jh7J7zz.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/sql-for-data-science\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"SQL for Data Science"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/789020ef94f9a6d9e9c44a18fc1ab67a","name":"Anoop Painuly","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/bfe7fbdf63c8ea01a62e174cb4d07a63","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1646340852140-96x96.jpg","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/1646340852140-96x96.jpg","caption":"Anoop Painuly"},"url":"https:\/\/www.comet.com\/site\/blog\/author\/painulyanoop5gmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=7262"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7262\/revisions"}],"predecessor-version":[{"id":15574,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/7262\/revisions\/15574"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=7262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=7262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=7262"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=7262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}