<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akshat Sharma</title>
    <description>The latest articles on DEV Community by Akshat Sharma (@akshat0610).</description>
    <link>https://dev.to/akshat0610</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1418400%2F44babddf-efd1-4cb5-ac68-82cc261bd270.jpeg</url>
      <title>DEV Community: Akshat Sharma</title>
      <link>https://dev.to/akshat0610</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akshat0610"/>
    <language>en</language>
    <item>
      <title>Day 7 of SQL Series || Keys</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Wed, 11 Dec 2024 14:35:28 +0000</pubDate>
      <link>https://dev.to/akshat0610/day-7-of-sql-series-keys-3aof</link>
      <guid>https://dev.to/akshat0610/day-7-of-sql-series-keys-3aof</guid>
      <description>&lt;p&gt;Hey there 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 🙂&lt;/p&gt;

&lt;p&gt;In the last blog we have discussed about ALTER command and its use cases, Order By and NULL Values. In this blog we are going to discuss about Keys and Joins in SQL.&lt;/p&gt;

&lt;p&gt;So let's get started 🔥&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fliso7rdqwr1r5konccwk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fliso7rdqwr1r5konccwk.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  DESC command in SQL
&lt;/h1&gt;

&lt;p&gt;To describe the structure of table in SQL we use &lt;strong&gt;DESCRIBE or DESC&lt;/strong&gt;(both are the same) commands.&lt;br&gt;
Let's suppose we have a users table that contains the id, name, email and age of any user. Here's how we have made it -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtb7floztpxehee3a7n2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtb7floztpxehee3a7n2.png" alt="Image description" width="492" height="327"&gt;&lt;/a&gt;&lt;br&gt;
So you can see that I have applied a primary key constraint on Id field. We will see what primary key is in a short time.&lt;br&gt;
Now to describe the structure of table we will use following command -:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;desc users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyd66vzj2q6ogc8zzw23x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyd66vzj2q6ogc8zzw23x.png" alt="Image description" width="800" height="307"&gt;&lt;/a&gt;&lt;br&gt;
So this is the output generated. Here we have information about every field in table. We have information about datatype, constraint, initial values, Null values and extra information.&lt;br&gt;
This is important when we are working with multiple tables and we want to look into structure of each table.&lt;/p&gt;

&lt;h1&gt;
  
  
  Keys in SQL
&lt;/h1&gt;

&lt;p&gt;In SQL, keys are essential constraints used to uniquely identify records in a table and establish relationships between tables. They ensure data integrity and prevent duplicate or invalid entries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Primary Key
&lt;/h2&gt;

&lt;p&gt;The PRIMARY KEY constraint uniquely identifies each record in a table. Primary keys must contain UNIQUE values, and cannot contain NULL values.&lt;/p&gt;

&lt;p&gt;Suppose we have a Student table that contains id, name and age of students in a class. Now here each student must have a unique id and each student must have a valid id. So we will apply a &lt;strong&gt;Primary Key&lt;/strong&gt; constraint to &lt;strong&gt;id&lt;/strong&gt; field. This is how we can do it -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few61qy59fg79l4wp78z8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few61qy59fg79l4wp78z8.png" alt="Image description" width="472" height="162"&gt;&lt;/a&gt;&lt;br&gt;
After adding some data to this table, this is how our table will look like -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp4dmc2d74q6joegerw2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp4dmc2d74q6joegerw2.png" alt="Image description" width="707" height="267"&gt;&lt;/a&gt;&lt;br&gt;
Now let's try to add another student with id &lt;strong&gt;1&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5mldqka1r6tmqjdnhahf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5mldqka1r6tmqjdnhahf.png" alt="Image description" width="372" height="127"&gt;&lt;/a&gt;&lt;br&gt;
We will get an error.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffahftq9m99o27kl6a0jf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffahftq9m99o27kl6a0jf.png" alt="Image description" width="555" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Each table can have atmost 1 primary key.&lt;/strong&gt; &lt;br&gt;
So let's try to add an column to our table with primary key constraint.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fws6h9kt5f9847aix1v3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fws6h9kt5f9847aix1v3m.png" alt="Image description" width="543" height="155"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxxuyb4aaqm90qkd3yp48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxxuyb4aaqm90qkd3yp48.png" alt="Image description" width="461" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We can composite multiple columns to create one Primary Key.&lt;/strong&gt;&lt;br&gt;
You know that Sql doesn't allow to make multiple primary keys but what if we are required to apply primary key constraint on more than one column. In this case we can combine the columns and apply primary key constraint on this composition. &lt;br&gt;
Let's create students table again and this time we will apply primary key on both id and name column.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pwuijw7undgfoboyrbq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pwuijw7undgfoboyrbq.png" alt="Image description" width="501" height="212"&gt;&lt;/a&gt;&lt;br&gt;
So here we have defined a composition of (id,name) as student and applied primary key on that.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnaz2h9qck05c2670mlc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdnaz2h9qck05c2670mlc.png" alt="Image description" width="706" height="245"&gt;&lt;/a&gt;&lt;br&gt;
This is how our table looks like initially, now let's try to add (1,"John",7) to this table.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkg4wtwnsf6y9m0n01e22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkg4wtwnsf6y9m0n01e22.png" alt="Image description" width="371" height="101"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffv9axrmacaba8jev6yqa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffv9axrmacaba8jev6yqa.png" alt="Image description" width="633" height="195"&gt;&lt;/a&gt;&lt;br&gt;
But let's try to add (5,"John",8) to this table-:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixuw8qkaljdoq6u38a0x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixuw8qkaljdoq6u38a0x.png" alt="Image description" width="397" height="167"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvifthc1sf6ntm5l04e16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvifthc1sf6ntm5l04e16.png" alt="Image description" width="729" height="282"&gt;&lt;/a&gt;&lt;br&gt;
So this data is added to table. Why?&lt;br&gt;
Because here the primary key constraint is applied to combination of (id,name) and we are adding distinct value of this composition.&lt;br&gt;
Note that this composition of keys is called &lt;strong&gt;Composite Key&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drop a Primary Key&lt;/strong&gt;&lt;br&gt;
So to drop a primary key this is how we can do it-:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8b83zl0yyp3rngu3fn7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8b83zl0yyp3rngu3fn7.png" alt="Image description" width="322" height="97"&gt;&lt;/a&gt;&lt;br&gt;
The syntax depends on the type of DBMS you are working with, above is used for MySql.&lt;/p&gt;

&lt;h1&gt;
  
  
  Unique Key
&lt;/h1&gt;

&lt;p&gt;Unique key ensures all values in a column (or a set of columns) are unique. Unlike the primary key, it allows one NULL value.&lt;br&gt;
So recreating students and setting constraint of &lt;strong&gt;id&lt;/strong&gt; field as &lt;strong&gt;unique key&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F28wwy7txugnp60dmxijh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F28wwy7txugnp60dmxijh.png" alt="Image description" width="413" height="152"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73mn6ssyj8p7p5vymafm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73mn6ssyj8p7p5vymafm.png" alt="Image description" width="692" height="198"&gt;&lt;/a&gt;&lt;br&gt;
This is our table. Now let's add data to only name and age column.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F59gm2q4o8i0xm9ujmty6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F59gm2q4o8i0xm9ujmty6.png" alt="Image description" width="696" height="237"&gt;&lt;/a&gt;&lt;br&gt;
A PRIMARY KEY constraint automatically has a UNIQUE constraint.&lt;br&gt;
However, you can have many UNIQUE constraints per table, but only one PRIMARY KEY constraint per table.&lt;/p&gt;

&lt;h1&gt;
  
  
  Candidate Key
&lt;/h1&gt;

&lt;p&gt;A column (or a set of columns) that can uniquely identify each record in a table. A table can have multiple candidate keys, but &lt;strong&gt;one is chosen as the Primary Key&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4yuxwu1b0fuxz7nokzq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4yuxwu1b0fuxz7nokzq.png" alt="Image description" width="800" height="215"&gt;&lt;/a&gt;&lt;br&gt;
Here both Email and EmployeeId can be candidate keys because both have to be unique for every employee. &lt;/p&gt;

&lt;h1&gt;
  
  
  Alternate Key
&lt;/h1&gt;

&lt;p&gt;Any candidate key that is not chosen as the primary key is alternate key. In above example Email is alternate key.&lt;/p&gt;

&lt;h1&gt;
  
  
  Super Key
&lt;/h1&gt;

&lt;p&gt;A superset of candidate keys that can uniquely identify each record in a table. It may include extra columns in addition to the candidate key. In the &lt;code&gt;Employees&lt;/code&gt; table, both &lt;code&gt;EmployeeID&lt;/code&gt; and &lt;code&gt;EmployeeID, Name&lt;/code&gt; are super keys.&lt;/p&gt;

&lt;h1&gt;
  
  
  Foreign Key
&lt;/h1&gt;

&lt;p&gt;A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in another table. The table with the foreign key is called the child table, and the table with the primary key is called the referenced or parent table. This is basically used to create a link between two tables.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mjmkflde0ynvbd2akxf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mjmkflde0ynvbd2akxf.png" alt="Image description" width="800" height="329"&gt;&lt;/a&gt;&lt;br&gt;
Here, DepartmentID in the Employees table is a foreign key referencing the Departments table.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8g2phxph4y5ay7cmnhyo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8g2phxph4y5ay7cmnhyo.png" alt="Image description" width="697" height="317"&gt;&lt;/a&gt;&lt;br&gt;
The FOREIGN KEY constraint prevents invalid data from being inserted into the foreign key column, because it has to be one of the values contained in the parent table.&lt;/p&gt;

&lt;p&gt;So these were Keys in SQL.&lt;br&gt;
In the next blog we will see joins.&lt;/p&gt;

&lt;p&gt;I hope you liked my blog. Please leave some ❤ and don't forget to follow me.&lt;br&gt;
Also have you checked my Instagram page where I upload necessary resources for software engineers.&lt;br&gt;
If not check it out here -:&lt;br&gt;
👉 Instagram: &lt;a href="https://www.instagram.com/fluxx_96/" rel="noopener noreferrer"&gt;https://www.instagram.com/fluxx_96/&lt;/a&gt;&lt;br&gt;
👉 YouTube: &lt;a href="https://www.youtube.com/@Fluxx-n4q/shorts" rel="noopener noreferrer"&gt;https://www.youtube.com/@Fluxx-n4q/shorts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thankyou 💙&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>sql</category>
    </item>
    <item>
      <title>Day 6 of SQL Series || Alter Table, Order By, NULL Values</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Tue, 10 Dec 2024 16:51:19 +0000</pubDate>
      <link>https://dev.to/akshat0610/day-6-of-sql-series-alter-table-order-by-null-values-18m5</link>
      <guid>https://dev.to/akshat0610/day-6-of-sql-series-alter-table-order-by-null-values-18m5</guid>
      <description>&lt;p&gt;Hey there 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 🙂&lt;/p&gt;

&lt;p&gt;In the last blog we have discussed about SQL operators ,wildcards and aggragate functions. In this blog we are going to see ALTER command and its use cases, Order By and  NULL Values.&lt;/p&gt;

&lt;p&gt;So let's get started 🔥&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F272ymwb04jz5yi20t0p9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F272ymwb04jz5yi20t0p9.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  ALTER Command in SQL
&lt;/h1&gt;

&lt;p&gt;The &lt;strong&gt;ALTER TABLE&lt;/strong&gt; statement is used to add, delete, or modify columns in an existing table. It is a &lt;strong&gt;DDL&lt;/strong&gt; command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use case 1 -:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Add a column in table&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose we have table that contains record of Students, their Name, Roll_no and IQ. Here is the table -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcb1g3sdmd3hbqx4qyemf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcb1g3sdmd3hbqx4qyemf.png" alt="Image description" width="696" height="275"&gt;&lt;/a&gt;&lt;br&gt;
Now here we need to add one more column to table and i.e. Grade column. Here's how we can do it -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0imd433nq6l6p8t4110.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0imd433nq6l6p8t4110.png" alt="Image description" width="416" height="121"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp74yifnyl7y6jqwkyg5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp74yifnyl7y6jqwkyg5k.png" alt="Image description" width="696" height="272"&gt;&lt;/a&gt;&lt;br&gt;
So initially the column will contain &lt;strong&gt;NULL&lt;/strong&gt; values as we have not specified any default value here.&lt;/p&gt;

&lt;p&gt;Now the important thing is how can we add data into this as per our existing data? &lt;br&gt;
So this is a tricky part here we can either introduce a formula and assign grades to each student as per that formula. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46njc0mqmzkp9rnpw9iq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46njc0mqmzkp9rnpw9iq.png" alt="Image description" width="661" height="225"&gt;&lt;/a&gt;&lt;br&gt;
So here &lt;strong&gt;Update&lt;/strong&gt; is used to update data in table then we have used &lt;strong&gt;Set&lt;/strong&gt; command to set the value of &lt;strong&gt;Grade&lt;/strong&gt; column according to different &lt;strong&gt;Cases&lt;/strong&gt;. It works more like a &lt;strong&gt;Switch&lt;/strong&gt; statement whenever it encounters a valid case then that value is of Grade is set.&lt;/p&gt;

&lt;p&gt;But what if you have enormous data and each column has a unique entry in that case we automate the process using external scripts or we use joins.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use case 2 -:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Drop a column in table&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now let's drop Grades column from our table.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy69l7oxovv5fsdr2s8kv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy69l7oxovv5fsdr2s8kv.png" alt="Image description" width="370" height="102"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftlvyux4nd6o2pvl070lb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftlvyux4nd6o2pvl070lb.png" alt="Image description" width="698" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that using the &lt;strong&gt;DROP&lt;/strong&gt; statement, the objects are permanently deleted or lost from a database, and they cannot be rolled back. &lt;/p&gt;

&lt;h3&gt;
  
  
  Use Case 3 -:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Rename a column in table&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's remane Roll_no column and change it to "Id".&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3340qrd60zzr7rxchwe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3340qrd60zzr7rxchwe.png" alt="Image description" width="518" height="140"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft2p3qkxsej521flsjopf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft2p3qkxsej521flsjopf.png" alt="Image description" width="692" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Order By Statement in SQL
&lt;/h1&gt;

&lt;p&gt;The &lt;strong&gt;ORDER BY&lt;/strong&gt; keyword is used to sort the result-set in ascending or descending order.&lt;/p&gt;

&lt;p&gt;We can sort our Student table based on IQ of students (ascending order)-:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsys0jfo88768ipohpo0p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsys0jfo88768ipohpo0p.png" alt="Image description" width="432" height="112"&gt;&lt;/a&gt;&lt;br&gt;
Here "ASC" refers ascending order.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy95p7rb6i1cghxsgx90d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy95p7rb6i1cghxsgx90d.png" alt="Image description" width="800" height="243"&gt;&lt;/a&gt;&lt;br&gt;
For descending order we will simply use "DESC".&lt;/p&gt;

&lt;p&gt;We can also order by multiple columns. For example we sort above table both on the basis of Id and IQ. So this is how we can do it.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxcfwjgfiw1rm4u5cvxe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxcfwjgfiw1rm4u5cvxe.png" alt="Image description" width="668" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  NULL Values in SQL
&lt;/h1&gt;

&lt;p&gt;An empty field in SQL which is not being explicitly initialized is set to NULL. As you have seen above when we added "Grade" column to our table, it was empty initially. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is Null operator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The IS NULL operator is used to test for empty values (NULL values).&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79qypfkkd6nthnnvs5d7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79qypfkkd6nthnnvs5d7.png" alt="Image description" width="407" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is Not Null operator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The IS NOT NULL operator is used to test for non-empty values (NOT NULL values).&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxv3ife527m22p7kouov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxv3ife527m22p7kouov.png" alt="Image description" width="421" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So these were Alter command, Order By and Null values in SQL.&lt;br&gt;
In the next blog we will see keys and joins.&lt;/p&gt;

&lt;p&gt;I hope you liked my blog. Please leave some ❤ and don't forget to follow me.&lt;br&gt;
Also have you checked my Instagram page where I upload necessary resources for software engineers.&lt;br&gt;
If not check it out here -:&lt;br&gt;
👉 Instagram: &lt;a href="https://www.instagram.com/fluxx_96/" rel="noopener noreferrer"&gt;https://www.instagram.com/fluxx_96/&lt;/a&gt;&lt;br&gt;
👉 YouTube: &lt;a href="https://www.youtube.com/@Fluxx-n4q/shorts" rel="noopener noreferrer"&gt;https://www.youtube.com/@Fluxx-n4q/shorts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thankyou 💙&lt;/p&gt;

</description>
      <category>sql</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Day 5 of SQL Series || Operators , Wildcards and Aggregate Functions</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Sat, 07 Dec 2024 13:16:07 +0000</pubDate>
      <link>https://dev.to/akshat0610/day-5-of-sql-series-operators-wildcards-and-aggregate-functions-28mf</link>
      <guid>https://dev.to/akshat0610/day-5-of-sql-series-operators-wildcards-and-aggregate-functions-28mf</guid>
      <description>&lt;p&gt;Hey there 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 🙂&lt;/p&gt;

&lt;p&gt;In the last blog we have discussed about SELECT command and different use cases. In this blog we are going to see SQL operators ,wildcards and aggragate functions. &lt;/p&gt;

&lt;p&gt;So let's get started 🔥&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8kylhma7aoasm40k470e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8kylhma7aoasm40k470e.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  SQL Operators
&lt;/h1&gt;

&lt;p&gt;SQL has different types of operators such as &lt;strong&gt;Arithmatic&lt;/strong&gt;, &lt;strong&gt;Bitwise&lt;/strong&gt;, &lt;strong&gt;Comparison&lt;/strong&gt;, &lt;strong&gt;Compound&lt;/strong&gt; and &lt;strong&gt;Logical&lt;/strong&gt; operators. We will see one use case of each operator.&lt;/p&gt;

&lt;h3&gt;
  
  
  Arithmatic Operator
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fro4qwlt1o4qn29mwlkw9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fro4qwlt1o4qn29mwlkw9.png" alt="Image description" width="448" height="365"&gt;&lt;/a&gt;&lt;br&gt;
These are used to perform basic arithmatics on SQL numerical data.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1d3yk0c0syl8setjqnc7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1d3yk0c0syl8setjqnc7.png" alt="Image description" width="345" height="85"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvdsp24uikbk0btl46hn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvdsp24uikbk0btl46hn.png" alt="Image description" width="800" height="97"&gt;&lt;/a&gt;&lt;br&gt;
We have aggregator functions to find the sum of complete column.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bitwise Operator
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjf9q4ffcddkxjdxsmzu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjf9q4ffcddkxjdxsmzu4.png" alt="Image description" width="522" height="211"&gt;&lt;/a&gt;&lt;br&gt;
These are basically used to do bitwise calculations.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm5f0jot2qis1nvgb2fq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm5f0jot2qis1nvgb2fq.png" alt="Image description" width="448" height="81"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fypi9cwl0bp70ih5aidk7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fypi9cwl0bp70ih5aidk7.png" alt="Image description" width="517" height="163"&gt;&lt;/a&gt;&lt;br&gt;
As bitwise representation of 3 is &lt;code&gt;011&lt;/code&gt; and 5 is &lt;code&gt;101&lt;/code&gt; there bitwise OR will be &lt;code&gt;111&lt;/code&gt; which is 7.&lt;/p&gt;

&lt;h3&gt;
  
  
  Comparison Operator
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bxno4mgdppua5ksi6nw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bxno4mgdppua5ksi6nw.png" alt="Image description" width="610" height="412"&gt;&lt;/a&gt;&lt;br&gt;
These are generally used with &lt;strong&gt;Where&lt;/strong&gt; keyword, they generally represents a condition in the query.&lt;br&gt;
Suppose we have a table that contain Students' roll_no, name and marks. &lt;br&gt;
Here is the table -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wfouv7670x2nbz0q481.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wfouv7670x2nbz0q481.png" alt="Image description" width="696" height="302"&gt;&lt;/a&gt;&lt;br&gt;
Now in this table we need to find the record of all those students whose marks is greater than or equal to 90. &lt;br&gt;
So this is how we can do this -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiq4m3810qz48hyzsfmni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiq4m3810qz48hyzsfmni.png" alt="Image description" width="482" height="132"&gt;&lt;/a&gt;&lt;br&gt;
So here we have applied condition on &lt;strong&gt;Marks&lt;/strong&gt; column and displayed the data of all those students whose &lt;strong&gt;Marks&amp;gt;=90&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgduk9k3ql28jys7aggkl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgduk9k3ql28jys7aggkl.png" alt="Image description" width="800" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Compound Operator
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fau1gmb0wao03b8yadsrw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fau1gmb0wao03b8yadsrw.png" alt="Image description" width="731" height="486"&gt;&lt;/a&gt;&lt;br&gt;
These are shorthand notations used to simplify expressions that update a column's value by performing an operation and then assigning the result back to that column.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1qnlzjap6lc36n3u3xo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1qnlzjap6lc36n3u3xo.png" alt="Image description" width="392" height="82"&gt;&lt;/a&gt;&lt;br&gt;
This query will update &lt;strong&gt;Student&lt;/strong&gt; table and increase &lt;strong&gt;Marks&lt;/strong&gt; of each student by 2. We can use this operation on applying condition too for eg marks of only those students should be increased whose roll_no is 5.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt; -: Compound operators are not supported in all SQL dialects. For example, they are widely used in T-SQL (SQL Server) but may not be supported in MySQL or Oracle.&lt;/p&gt;

&lt;h3&gt;
  
  
  Logical Operator
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbc8qqfpo6ayx5sfhuj09.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbc8qqfpo6ayx5sfhuj09.png" alt="Image description" width="712" height="601"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Wildcards
&lt;/h1&gt;

&lt;p&gt;A wildcard character is used to substitute one or more characters in a string.&lt;br&gt;
Wildcard characters are used with the &lt;strong&gt;LIKE&lt;/strong&gt; operator. The LIKE operator is used in a &lt;strong&gt;WHERE&lt;/strong&gt; clause to search for a specified pattern in a column.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wildcard Characters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow4j6iqfcxc5q3myqtjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow4j6iqfcxc5q3myqtjs.png" alt="Image description" width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not supported in PostgreSQL and MySQL databases.
** Supported only in Oracle databases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suppose we need to display all the students whose name starts with 'J. Here's how we can do it-:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foiyd0gqoprmqjrkyv276.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foiyd0gqoprmqjrkyv276.png" alt="Image description" width="371" height="77"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F167pp8zaggvhibyfz4m2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F167pp8zaggvhibyfz4m2.png" alt="Image description" width="800" height="157"&gt;&lt;/a&gt;&lt;br&gt;
Wildcards in SQL uses &lt;strong&gt;Regular Expression Matching or Regex&lt;/strong&gt; behind the scenes.&lt;/p&gt;

&lt;h1&gt;
  
  
  Aggregator Functions
&lt;/h1&gt;

&lt;p&gt;An &lt;strong&gt;aggregate function&lt;/strong&gt; is a function that performs a calculation on a set of values, and returns a single value.&lt;/p&gt;

&lt;p&gt;The most commonly used SQL aggregate functions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;MIN()&lt;/code&gt; - returns the smallest value within the selected column&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MAX()&lt;/code&gt; - returns the largest value within the selected column&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;COUNT()&lt;/code&gt; - returns the number of rows in a set&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SUM()&lt;/code&gt; - returns the total sum of a numerical column&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AVG()&lt;/code&gt; - returns the average value of a numerical column&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of the above functions (except Count()) ignores Null values.&lt;br&gt;
Suppose we need to find &lt;strong&gt;average&lt;/strong&gt; marks of all students. This is how we can do it-:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcl6fdqbqodw6k9cq3aoy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcl6fdqbqodw6k9cq3aoy.png" alt="Image description" width="420" height="67"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjt2198yg5onpebn78vdf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjt2198yg5onpebn78vdf.png" alt="Image description" width="357" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Group By&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;GROUP BY&lt;/code&gt; clause in SQL is used to group rows with the same values in specified columns into aggregated data. It is often used in conjunction with aggregate functions such as &lt;code&gt;COUNT()&lt;/code&gt;, &lt;code&gt;SUM()&lt;/code&gt;, &lt;code&gt;AVG()&lt;/code&gt;, &lt;code&gt;MAX()&lt;/code&gt;, and &lt;code&gt;MIN()&lt;/code&gt; to perform calculations on each group.&lt;/p&gt;

&lt;p&gt;So these were SQL operators, wildcard and aggregating functions. &lt;br&gt;
In the next blog we will see alter table and its use cases.&lt;/p&gt;

&lt;p&gt;I hope you liked my blog. Please leave some ❤ and don't forget to follow me.&lt;br&gt;
Also have you checked my Instagram page where I upload necessary resources for software engineers.&lt;br&gt;
If not check it out here -:&lt;br&gt;
👉 Instagram: &lt;a href="https://www.instagram.com/fluxx_96/" rel="noopener noreferrer"&gt;https://www.instagram.com/fluxx_96/&lt;/a&gt;&lt;br&gt;
👉 YouTube: &lt;a href="https://www.youtube.com/@Fluxx-n4q/shorts" rel="noopener noreferrer"&gt;https://www.youtube.com/@Fluxx-n4q/shorts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thankyou 💙&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>sql</category>
      <category>beginners</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Day 4 of SQL Series || SELECT Statement Use cases</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Thu, 05 Dec 2024 16:31:12 +0000</pubDate>
      <link>https://dev.to/akshat0610/day-4-of-sql-series-select-statement-use-cases-4jcg</link>
      <guid>https://dev.to/akshat0610/day-4-of-sql-series-select-statement-use-cases-4jcg</guid>
      <description>&lt;p&gt;Hey there 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 🙂&lt;/p&gt;

&lt;p&gt;In the last blog we have discussed about DML (Data Manipulation Language) commands. In this blog we are going to see some of the basic commands of SQL. We will be discussing about SELECT command and different use cases in this blog.&lt;/p&gt;

&lt;p&gt;So let's get started 🔥&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F37dlf410fcud2gsvdltd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F37dlf410fcud2gsvdltd.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SELECT Statement
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;SELECT&lt;/strong&gt; statement is used to select data from the database or more specifically table.&lt;br&gt;
To understand this in a more better way we are going to use our &lt;strong&gt;Student&lt;/strong&gt; table from last blog. Here is the table -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyhec6ygp3ev8lab90yld.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyhec6ygp3ev8lab90yld.png" alt="Image description" width="697" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Case 1
&lt;/h3&gt;

&lt;p&gt;Selecting all rows of table -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkgkfn3v54rhah6tl09ux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkgkfn3v54rhah6tl09ux.png" alt="Image description" width="382" height="83"&gt;&lt;/a&gt;&lt;br&gt;
So here &lt;strong&gt;Select&lt;/strong&gt; is used to select data &lt;strong&gt;'*'&lt;/strong&gt; refers to all the rows or complete data. &lt;br&gt;
Here is output -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpanh8ifypq012z9nferj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpanh8ifypq012z9nferj.png" alt="Image description" width="800" height="246"&gt;&lt;/a&gt;&lt;br&gt;
I can't able to show complete output here but you will get it when you try it on your own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Case 2
&lt;/h3&gt;

&lt;p&gt;Selecting specific column from table -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ym1s0hf6909m66uh996.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ym1s0hf6909m66uh996.png" alt="Image description" width="302" height="87"&gt;&lt;/a&gt;&lt;br&gt;
This query will display complete data of Name column.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqb48x7dswvly8vvf0pn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqb48x7dswvly8vvf0pn.png" alt="Image description" width="800" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Case 3
&lt;/h2&gt;

&lt;p&gt;Select distinct items from table -:&lt;br&gt;
For this I'll add some duplicate rows in table. So our table will look like -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm0izhtkh2jeflrbgt422.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm0izhtkh2jeflrbgt422.png" alt="Image description" width="717" height="462"&gt;&lt;/a&gt;&lt;br&gt;
Now we will select only distinct rows here.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7p3kwc3q53qig3rc7jj4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7p3kwc3q53qig3rc7jj4.png" alt="Image description" width="406" height="96"&gt;&lt;/a&gt;&lt;br&gt;
So here we are using &lt;strong&gt;distinct&lt;/strong&gt; to select distinct rows and &lt;strong&gt;'*'&lt;/strong&gt; for selecting all columns. We can select distinct values from a particular column too for this you just need to replace * from column name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpqh9kygllmo2t827jque.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpqh9kygllmo2t827jque.png" alt="Image description" width="800" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Case 4
&lt;/h2&gt;

&lt;p&gt;Selecting all the students of Class &lt;strong&gt;5B&lt;/strong&gt; -: &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fck5e2dg7324rzm5hi0ey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fck5e2dg7324rzm5hi0ey.png" alt="Image description" width="433" height="106"&gt;&lt;/a&gt;&lt;br&gt;
In the above query &lt;strong&gt;where&lt;/strong&gt; is used to filter records based on specified condition. Here we are selecting all the students of Class &lt;strong&gt;5B&lt;/strong&gt;.&lt;br&gt;
Here is the output -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbh1uil4anry0igbql2ua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbh1uil4anry0igbql2ua.png" alt="Image description" width="800" height="263"&gt;&lt;/a&gt;&lt;br&gt;
We can also select &lt;strong&gt;distinct&lt;/strong&gt; entries all we need to use is &lt;strong&gt;Distinct&lt;/strong&gt; keyword here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Case 5
&lt;/h2&gt;

&lt;p&gt;Selecting all the students whose &lt;strong&gt;Roll_no&lt;/strong&gt; is between 12 and 21-:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32jhwh1jq17cfon81oxk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F32jhwh1jq17cfon81oxk.png" alt="Image description" width="452" height="110"&gt;&lt;/a&gt;&lt;br&gt;
Here we have applied a condition on &lt;strong&gt;Roll_no&lt;/strong&gt; and based on that condition output is generated.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2s2pq4f7ufohswnkuc3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2s2pq4f7ufohswnkuc3.png" alt="Image description" width="800" height="184"&gt;&lt;/a&gt;&lt;br&gt;
You can apply different operations here for example selecting students with roll_no greater than a particular value or selecting students having roll_no equal to particular value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Case 6
&lt;/h2&gt;

&lt;p&gt;Selecting all the students whose name starts with &lt;strong&gt;J&lt;/strong&gt;-:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy6hcxm8ovwzv8c0zqfr5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy6hcxm8ovwzv8c0zqfr5.png" alt="Image description" width="340" height="103"&gt;&lt;/a&gt;&lt;br&gt;
Here we have used &lt;strong&gt;like&lt;/strong&gt; and &lt;code&gt;'J%'&lt;/code&gt;. &lt;br&gt;
The &lt;strong&gt;like&lt;/strong&gt; operator is used with &lt;strong&gt;where&lt;/strong&gt; clause to search for a pattern in string. &lt;br&gt;
&lt;strong&gt;%&lt;/strong&gt; represents zero, one, or multiple characters, so here we have given the starting character of the string i.e. 'J'.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7q6s6uahliyig2igo1ah.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7q6s6uahliyig2igo1ah.png" alt="Image description" width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Case 7
&lt;/h2&gt;

&lt;p&gt;Selecting only first 3 records from table -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftjhsc9iwtyv1g8ia901z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftjhsc9iwtyv1g8ia901z.png" alt="Image description" width="385" height="87"&gt;&lt;/a&gt;&lt;br&gt;
Here we have used &lt;strong&gt;limit&lt;/strong&gt; keyword to show top 3 rows this is a &lt;strong&gt;MySQL&lt;/strong&gt; based syntax different management systems have different syntax like in &lt;strong&gt;Oracle&lt;/strong&gt; based system we can do it by just applying a condition on &lt;strong&gt;ROWNUM&lt;/strong&gt; or you can use &lt;strong&gt;FETCH FIRST&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxb64eczkexycxy1cssfd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxb64eczkexycxy1cssfd.png" alt="Image description" width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So these were some basic &lt;strong&gt;Select&lt;/strong&gt; command usecases. This was just an introduction we will see some good use cases in upcoming blogs.&lt;br&gt;
In the next blog we will see operators and wildcards and its use cases.&lt;/p&gt;

&lt;p&gt;I hope you liked my blog. Please leave some ❤ and don't forget to follow me.&lt;br&gt;
Also have you checked my Instagram page where I upload necessary resources for software engineers.&lt;br&gt;
If not check it out here -:&lt;br&gt;
👉 Instagram: &lt;a href="https://www.instagram.com/fluxx_96/" rel="noopener noreferrer"&gt;https://www.instagram.com/fluxx_96/&lt;/a&gt;&lt;br&gt;
👉 YouTube: &lt;a href="https://www.youtube.com/@Fluxx-n4q/shorts" rel="noopener noreferrer"&gt;https://www.youtube.com/@Fluxx-n4q/shorts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thankyou 💙&lt;/p&gt;

</description>
      <category>sql</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Day 3 of SQL Series || Basic Commands</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Mon, 02 Dec 2024 12:01:13 +0000</pubDate>
      <link>https://dev.to/akshat0610/day-3-of-sql-series-basic-commands-1mo5</link>
      <guid>https://dev.to/akshat0610/day-3-of-sql-series-basic-commands-1mo5</guid>
      <description>&lt;p&gt;Hey there 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 🙂&lt;/p&gt;

&lt;p&gt;In the last blog we have discussed about DDL (Data Definition Language) commands. In this blog we are going to see some of the basic commands of SQL. We will be discussing DML (Data Manipulation Language) commands in this blog.&lt;/p&gt;

&lt;p&gt;So let's get started 🔥&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0x93biqaxgtx6vsodjt0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0x93biqaxgtx6vsodjt0.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Manipulation Language Commands
&lt;/h2&gt;

&lt;p&gt;Data Manipulation Language (DML) Commands are used to manipulate data present in the database. &lt;br&gt;
Some of the commonly used DML commands are -:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;INSERT&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;UPDATE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DELETE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LOCK&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CALL&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EXPLAIN PLAIN&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this blog we will be focusing on the above three commands, we will look the last three commands in upcoming blog.&lt;/p&gt;

&lt;h2&gt;
  
  
  INSERT Command
&lt;/h2&gt;

&lt;p&gt;In the last blog we have seen how to create a table let me explain you again with an example -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqcw3t4n1kx18mu69bsy0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqcw3t4n1kx18mu69bsy0.png" alt="Image description" width="432" height="237"&gt;&lt;/a&gt;&lt;br&gt;
So here we have created a table named &lt;strong&gt;Student&lt;/strong&gt; that contains three variables namely &lt;strong&gt;Name&lt;/strong&gt; (a string of atmost 50 characters), &lt;strong&gt;Roll_no&lt;/strong&gt; (an integer value) and &lt;strong&gt;Class&lt;/strong&gt; (a string of atmost 10 characters).&lt;/p&gt;

&lt;p&gt;We will understand table schema in the next blog for now we will try to insert some data in this table.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1s38s25pmmr8wvf8lhr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1s38s25pmmr8wvf8lhr.png" alt="Image description" width="795" height="117"&gt;&lt;/a&gt;&lt;br&gt;
So we have added three rows in our table. Now our table looks like this -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvaufr5u0kw8axecpolo5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvaufr5u0kw8axecpolo5.png" alt="Image description" width="671" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you may have understood that &lt;strong&gt;INSERT&lt;/strong&gt; command is used to insert data in table. It allows for the insertion of data either by specifying the column names along with the values or by providing values for all columns in the table.&lt;br&gt;
So this is one usecase here now suppose we need to insert values of only first two columns how are we going to do that. Let's see-: &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fur3xetupg2uo6943ejp7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fur3xetupg2uo6943ejp7.png" alt="Image description" width="446" height="112"&gt;&lt;/a&gt;&lt;br&gt;
So here we have specified the column names in which we want to insert values. Let's have a look on our table now -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnzglf5a1fsyubauthpj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnzglf5a1fsyubauthpj.png" alt="Image description" width="672" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will see some advanced use cases of this command in coming blogs. For now let's keep it simple.&lt;/p&gt;

&lt;h2&gt;
  
  
  UPDATE Command
&lt;/h2&gt;

&lt;p&gt;Now suppose we need to &lt;strong&gt;update&lt;/strong&gt; the existing data in the table.&lt;br&gt;
Let's suppose in the above table we need to update the row with &lt;code&gt;Name="Raj"&lt;/code&gt;. So here's how we will do it-:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79kyolqule4vlr0a4gm3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79kyolqule4vlr0a4gm3.png" alt="Image description" width="800" height="114"&gt;&lt;/a&gt;&lt;br&gt;
So here we have updated the table &lt;strong&gt;Student&lt;/strong&gt;. For this we have selected the row with Roll_no 30 and then we set the &lt;strong&gt;Name&lt;/strong&gt; as "Anand".&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrjm05i88i8imwmytnlb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrjm05i88i8imwmytnlb.png" alt="Image description" width="667" height="272"&gt;&lt;/a&gt;&lt;br&gt;
This is one of the simplest use case of &lt;strong&gt;UPDATE&lt;/strong&gt; command. For advanced use cases we need to understand more commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  DELETE Command
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;DELETE&lt;/strong&gt; command is used to remove one or more rows from table depending on the condition we imply. Unlike the DROP statement, which removes the entire table, the DELETE statement removes data (rows) from the table retaining only the table structure, constraints, and schema.&lt;/p&gt;

&lt;p&gt;In the above table we will remove the last two rows. This is how we will do it -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3eyeb9hn2v1r9b657tst.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3eyeb9hn2v1r9b657tst.png" alt="Image description" width="800" height="96"&gt;&lt;/a&gt;&lt;br&gt;
As we have not provided any value in &lt;strong&gt;Class&lt;/strong&gt; column in last two rows that is why we have used the condition &lt;code&gt;Class is NULL&lt;/code&gt; as by default CLASS column is initialized by NULL.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F99y2y4dbstzp5hp6h43q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F99y2y4dbstzp5hp6h43q.png" alt="Image description" width="652" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So these were three basic DML commands. This was just an introduction we will see some good use cases in upcoming blogs. &lt;br&gt;
In the next blog we will see &lt;strong&gt;SELECT&lt;/strong&gt; statement and its use cases.&lt;/p&gt;

&lt;p&gt;I hope you liked my blog. Please leave some ❤ and don't forget to follow me.&lt;br&gt;
Also have you checked my Instagram page where I upload necessary resources for software engineers.&lt;br&gt;
If not check it out here -:&lt;br&gt;
👉 Instagram: &lt;a href="https://www.instagram.com/fluxx_96/" rel="noopener noreferrer"&gt;https://www.instagram.com/fluxx_96/&lt;/a&gt;&lt;br&gt;
👉 YouTube: &lt;a href="https://www.youtube.com/@Fluxx-n4q/shorts" rel="noopener noreferrer"&gt;https://www.youtube.com/@Fluxx-n4q/shorts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thankyou 💙&lt;/p&gt;

</description>
      <category>sql</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Day 2 of SQL Series || Basic Commands</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Sat, 23 Nov 2024 11:31:28 +0000</pubDate>
      <link>https://dev.to/akshat0610/day-2-of-sql-series-basic-commands-5bn6</link>
      <guid>https://dev.to/akshat0610/day-2-of-sql-series-basic-commands-5bn6</guid>
      <description>&lt;p&gt;Hey there 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 🙂&lt;/p&gt;

&lt;p&gt;In the last blog we have discussed about basic introduction to SQL. In this blog we are going to see some of the basic commands of SQL. We will be discussing &lt;strong&gt;DDL (Data Definition Language) commands&lt;/strong&gt; in this blog.&lt;/p&gt;

&lt;p&gt;So let's get started 🔥&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa86i8k93j0g2004yu9pp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa86i8k93j0g2004yu9pp.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL Commands
&lt;/h2&gt;

&lt;p&gt;Before starting our discussion I want tell you that you can practice SQL on the available online SQL compilers. I am attaching link of one here 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.programiz.com/sql/online-compiler/" rel="noopener noreferrer"&gt;https://www.programiz.com/sql/online-compiler/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In SQL, &lt;strong&gt;DDL (Data Definition Language)&lt;/strong&gt; commands are used to define, modify, and manage the structure of database objects such as tables, indexes, and schemas. Here’s a comprehensive list of all commonly used DDL commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;CREATE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ALTER&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DROP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TRUNCATE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RENAME&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;COMMENT&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;USE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SHOW&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  CREATE Command
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;CREATE&lt;/strong&gt; command is create new database objects such as tables, views, indexes, and databases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a Database&lt;/strong&gt; -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcofhwh4so4ywq2tz7zzs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcofhwh4so4ywq2tz7zzs.png" alt="Image description" width="800" height="62"&gt;&lt;/a&gt;&lt;em&gt;Note -: The statement will throw an error when you are working on an online compiler.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a Table&lt;/strong&gt; -: &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0vaf9bqj3grqfjnkxr3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0vaf9bqj3grqfjnkxr3.png" alt="Image description" width="755" height="190"&gt;&lt;/a&gt; Example -:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8n7r0vu860u73hgib3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8n7r0vu860u73hgib3k.png" alt="Image description" width="581" height="216"&gt;&lt;/a&gt;&lt;br&gt;
So here we have created a table named &lt;code&gt;student_record&lt;/code&gt; that contains three type of data &lt;strong&gt;student's name&lt;/strong&gt; which will be a string of atmost 100 characters, &lt;strong&gt;student's age&lt;/strong&gt; which will be of integer type and &lt;strong&gt;student's ID&lt;/strong&gt; which will also be a string of atmost 30 characters.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note that duplicate column names (same name and same type) are not allowed.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SHOW Command
&lt;/h3&gt;

&lt;p&gt;Used to display the metadata about database objects, such as tables or databases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Show Database&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmr0fxpmk193mj8npgrjw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmr0fxpmk193mj8npgrjw.png" alt="Image description" width="800" height="66"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Show Tables&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F74qlq2auiiyurrr89oa2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F74qlq2auiiyurrr89oa2.png" alt="Image description" width="800" height="71"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Show Table Structure&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbajbc17tvjlb5rjbrw40.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbajbc17tvjlb5rjbrw40.png" alt="Image description" width="800" height="61"&gt;&lt;/a&gt;&lt;br&gt;
This command &lt;strong&gt;DESCRIBE&lt;/strong&gt; is used to see complete table structure it gives complete detail of all columns in table.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  USE Command
&lt;/h3&gt;

&lt;p&gt;This command is used to select a specific database to work with in a session.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzd5bntv509f2tow90gx2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzd5bntv509f2tow90gx2.png" alt="Image description" width="800" height="68"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  COMMENT Command
&lt;/h3&gt;

&lt;p&gt;It is used to add comments to database objects like tables or columns for documentation purposes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add a Comment to a Table&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqtg8wi7c76t4pctlhu7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqtg8wi7c76t4pctlhu7.png" alt="Image description" width="800" height="58"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add a Comment to a Column&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzmjuad7sra8tx7lfe7a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzmjuad7sra8tx7lfe7a.png" alt="Image description" width="800" height="58"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ALTER Command
&lt;/h3&gt;

&lt;p&gt;It is used to modify existing database objects such as tables, columns, and constraints.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add a Column&lt;/strong&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiujmaz5o6024nfegm4gl.png" alt="Image description" width="800" height="63"&gt;
For example, Suppose we have a table that stores customers' data.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjqb0vg0mjv3pscdh8p5j.png" alt="Image description" width="656" height="268"&gt;
Now we will add an "Email" column here.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flg22yhaqn68p6sxlwmp5.png" alt="Image description" width="515" height="92"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhqz0k3yweqv2zyxlvzj.png" alt="Image description" width="663" height="281"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-&lt;strong&gt;Modify a Column&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3tceroidadinwt9aj9g6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3tceroidadinwt9aj9g6.png" alt="Image description" width="800" height="68"&gt;&lt;/a&gt;&lt;br&gt;
Here we are changing data type of column. &lt;br&gt;
&lt;em&gt;Note that the &lt;code&gt;ALTER TABLE&lt;/code&gt; syntax can vary depending on the SQL dialect (e.g., MySQL, PostgreSQL, SQL Server, etc.) you're using. Some may support a particular keyword some may throw error.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  DROP Command
&lt;/h3&gt;

&lt;p&gt;It is used to delete database objects such as tables, databases, or indexes. This operation removes the object and its data permanently.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F99qrnbsaskxsn8xujcu2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F99qrnbsaskxsn8xujcu2.png" alt="Image description" width="381" height="102"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  RENAME Command
&lt;/h3&gt;

&lt;p&gt;It is used to rename a database object, such as a table or a view.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmtamic3788a5m9x4zov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmtamic3788a5m9x4zov.png" alt="Image description" width="327" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  TRUNCATE Command
&lt;/h3&gt;

&lt;p&gt;It is used to remove all rows from a table without logging individual row deletions, resetting the table for new data. This does not affect the table structure. This means the table become empty.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0qmmhhx6t78mx68ruda.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0qmmhhx6t78mx68ruda.png" alt="Image description" width="365" height="83"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So these were all DDL Commands of SQL. In the next blog we will see some DML commands and will run different queries on table. &lt;br&gt;
I hope you liked my blog. Please leave some ❤ and don't forget to follow me.&lt;br&gt;
Also have you checked my Instagram page where I upload necessary resources for software engineers.&lt;br&gt;
If not check it out here -:&lt;br&gt;
👉 Instagram: &lt;a href="https://www.instagram.com/fluxx_96/" rel="noopener noreferrer"&gt;https://www.instagram.com/fluxx_96/&lt;/a&gt;&lt;br&gt;
👉 YouTube: &lt;a href="https://www.youtube.com/@Fluxx-n4q/shorts" rel="noopener noreferrer"&gt;https://www.youtube.com/@Fluxx-n4q/shorts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thankyou 💙&lt;/p&gt;

</description>
      <category>sql</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>mysql</category>
    </item>
    <item>
      <title>Day 1 SQL Series || Introduction to SQL</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Thu, 21 Nov 2024 10:29:51 +0000</pubDate>
      <link>https://dev.to/akshat0610/day-1-sql-series-introduction-to-sql-3347</link>
      <guid>https://dev.to/akshat0610/day-1-sql-series-introduction-to-sql-3347</guid>
      <description>&lt;p&gt;Hey there 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 🙂&lt;/p&gt;

&lt;p&gt;In the last blog as I have promised that I'll be starting a 7 days &lt;strong&gt;SQL series&lt;/strong&gt; so here it is. In this blog we will discuss the basic &lt;strong&gt;introduction to SQL&lt;/strong&gt; and &lt;strong&gt;database&lt;/strong&gt; and &lt;strong&gt;tabular/relational&lt;/strong&gt; and &lt;strong&gt;non relational database management systems&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So let's get started 🔥&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nmjhciezvua3z5bvr41.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nmjhciezvua3z5bvr41.png" alt="Image description" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Data?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Data&lt;/strong&gt; is a &lt;strong&gt;collection&lt;/strong&gt; of facts and figures or more specifically information that is gathered by observations, measurements, research or analysis. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Database?
&lt;/h2&gt;

&lt;p&gt;Now we need something where we can store our data and can easily manipulate and retrieve it. So here comes &lt;strong&gt;Database&lt;/strong&gt; in picture.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Database&lt;/strong&gt; is a systematically organized collection of data stored electronically in a computer system. It allows for efficient storage, manipulation, and retrieval of data as needed. Databases are managed using software called a &lt;strong&gt;Database Management System (DBMS)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd4eezuht15dlx75sswuq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd4eezuht15dlx75sswuq.png" alt="Image description" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Database Management Systems
&lt;/h2&gt;

&lt;p&gt;The Database Management Systems are classified into two main types -:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Relational DBMS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Non relational DBMS&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Relational DBMS
&lt;/h3&gt;

&lt;p&gt;Relational DBMS or RDBMS stores data in tables with rows and columns and it requires a predefined schema that defines the structure of the data (e.g., data types, constraints). It ensures data integrity and reliability through ACID -:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Atomicity: Transactions are all-or-nothing.This ensures the data operation will complete either with success or with failure.For example, a transaction will either be committed or will abort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consistency: Ensures data validity.If we perform any operation over the data, its value before and after the operation should be preserved. For example, the account balance before and after the transaction should be correct, i.e., it should remain conserved.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Isolation: Concurrent transactions do not interfere.There can be concurrent users for accessing data at the same time from the database. Thus, isolation between the data should remain isolated. For example, when multiple transactions occur at the same time, one transaction effects should not be visible to the other transactions in the database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Durability: Data changes persist after transactions.It ensures that once it completes the operation and commits the data, data changes should remain permanent.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc13meps4endjrodt1wlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc13meps4endjrodt1wlj.png" alt="Image description" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Non Relational Database Management System
&lt;/h3&gt;

&lt;p&gt;Non Relational DBMS or NoSql Database does not follow the traditional table-based relational model. It is designed for flexible, unstructured, or semi-structured data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbkm18fci5xp6c9ncigb6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbkm18fci5xp6c9ncigb6.png" alt="Image description" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we know that what data, database, types of database and DBMS actually is, there arises a question that how exaclty the data is managed 🤔?&lt;br&gt;
So to answer this question we need to understand &lt;strong&gt;SQL&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to SQL
&lt;/h2&gt;

&lt;p&gt;SQL is a standard language for accessing and manipulating databases.&lt;br&gt;
SQL stands for &lt;strong&gt;Structured Query Language&lt;/strong&gt; that is used to access and manipulate &lt;strong&gt;Relational Database&lt;/strong&gt;. &lt;br&gt;
SQL was primarily designed for managing Relational Databases. &lt;br&gt;
It was developed by &lt;strong&gt;IBM Computer Scientists&lt;/strong&gt; in the &lt;strong&gt;1970s&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
It consists of different queries that can be used to create, insert, delete and change data. &lt;br&gt;
SQL is one of the widely used languages for tabular data. Even if you are someone who aspires to be an ML engineer SQL plays a very significant role. &lt;/p&gt;

&lt;h2&gt;
  
  
  Features of SQL
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Definition Language (DDL)&lt;/strong&gt; -: SQL allows you to define the structure of a database using commands.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Manipulation (DML)&lt;/strong&gt; -: SQL enables inserting, updating, deleting, and retrieving data using its commands.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transaction Control (TCL)&lt;/strong&gt; -: SQL supports transactions to ensure data integrity. We can easily save or undo changes in transactions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Control (DCL)&lt;/strong&gt; -: SQL includes commands to manage user permissions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Standardized&lt;/strong&gt; -: SQL is standardized by ANSI and ISO, ensuring compatibility across different relational database systems (e.g., MySQL, PostgreSQL, SQL Server).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt; -: SQL works well with databases of any size, from small projects to enterprise-level systems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integration with Programming&lt;/strong&gt; -: SQL can be integrated with programming languages (e.g., Python, Java, C#) to create dynamic applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In conclusion SQL is basically a language used to manipulate RDBMS. Now in the next blog we will see some basic commands of SQL.&lt;br&gt;
I hope you have enjoyed this blog. Please leave a ❤ and if I have missed something or you have doubts we can discuss them in comments.&lt;/p&gt;

&lt;p&gt;Thankyou 💙&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>database</category>
      <category>sql</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Launched a Social Page for every Software Engineer</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Wed, 20 Nov 2024 12:03:33 +0000</pubDate>
      <link>https://dev.to/akshat0610/launched-a-social-page-for-every-software-engineer-2k0c</link>
      <guid>https://dev.to/akshat0610/launched-a-social-page-for-every-software-engineer-2k0c</guid>
      <description>&lt;p&gt;👋 Hello People!&lt;/p&gt;

&lt;p&gt;I hope you're all doing well! 😊&lt;/p&gt;

&lt;p&gt;✨ It’s been a while since I last posted here, and I truly apologize for the unexpected break. But guess what? I’m back! 🎉 And this time, I have some exciting news to share with you all.&lt;/p&gt;

&lt;p&gt;Your support and feedback have been invaluable in my journey, and I’m incredibly grateful to this amazing community. 🙌&lt;/p&gt;

&lt;p&gt;💡 So, where was I?&lt;/p&gt;

&lt;p&gt;During this time, I’ve been working hard on a passion project—&lt;strong&gt;a social media page&lt;/strong&gt;—and I’m thrilled to announce that it’s now LIVE! 🚀&lt;/p&gt;

&lt;p&gt;🌟 The page is called &lt;strong&gt;Fluxx&lt;/strong&gt;, and it’s a space where I share:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;💻 Essential resources&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🛣️ Detailed roadmaps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🎥 Short and practical tutorials&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole idea behind Fluxx is to spread knowledge and help fellow developers by providing valuable resources and guidance.&lt;/p&gt;

&lt;p&gt;🔗 Check it out here:&lt;br&gt;
👉 Instagram: &lt;a href="https://www.instagram.com/fluxx_96/" rel="noopener noreferrer"&gt;https://www.instagram.com/fluxx_96/&lt;/a&gt;&lt;br&gt;
👉 YouTube: &lt;a href="https://www.youtube.com/@Fluxx-n4q" rel="noopener noreferrer"&gt;https://www.youtube.com/@Fluxx-n4q&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✨ Please take a look, explore the content, and let me know your thoughts! I’d love to hear your feedback and suggestions to make it even better. If you find the content useful, don’t forget to follow and share it with others. It would mean the world to me! 🌍&lt;/p&gt;

&lt;p&gt;But wait… there’s more!&lt;/p&gt;

&lt;p&gt;🎉 Surprise Alert! 🎉&lt;/p&gt;

&lt;p&gt;I’m launching an ultimate &lt;strong&gt;7-day SQL series&lt;/strong&gt; right here on &lt;strong&gt;Dev Community&lt;/strong&gt;! 🗂️ Get ready to dive into some amazing SQL tips and tricks over the next week.&lt;/p&gt;

&lt;p&gt;❤️ If you enjoyed this post or found it helpful, don’t forget to leave a heart and share it with your friends.&lt;/p&gt;

&lt;p&gt;Thank you so much for your support, Dev Community! 💙 Let’s continue to grow, learn, and build together.&lt;/p&gt;

</description>
      <category>socialmedia</category>
      <category>softwareengineering</category>
      <category>beginners</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>What I have learnt from solving 1600 Leetcode Problems 🤯|| DSA Guide</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Wed, 23 Oct 2024 08:50:40 +0000</pubDate>
      <link>https://dev.to/akshat0610/what-i-have-learnt-from-solving-1600-leetcode-problems-dsa-guide-2o0g</link>
      <guid>https://dev.to/akshat0610/what-i-have-learnt-from-solving-1600-leetcode-problems-dsa-guide-2o0g</guid>
      <description>&lt;p&gt;Hey there! 👋 Hope you’re doing well 🙂&lt;br&gt;
As software engineers, we know that landing an SDE role at a multinational company or a startup means one thing — mastering Data Structures and Algorithms (aka DSA) is key. And with that in mind (and maybe a little obsessed 😅), I’ve solved 1600 DSA problems! 🤯&lt;/p&gt;

&lt;p&gt;In this blog, I’ll share how tackling this many DSA problems has impacted me and whether solving that many is really necessary.&lt;/p&gt;

&lt;p&gt;So, let’s dive in! 🔥&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ehs67g9l6rzhl4qh8rw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ehs67g9l6rzhl4qh8rw.png" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  My DSA Journey: Solving 1600 Problems and What I Learned Along the Way
&lt;/h1&gt;

&lt;p&gt;I started my DSA journey back in 2021, during my second year of college. I gathered all the resources I could find and explored every platform where I could practice problems.&lt;/p&gt;

&lt;p&gt;I began with basic array problems on Leetcode, tagged as “Easy.” But as I worked through them, I noticed various tags like Prefix Sum, Hash Table, Greedy, etc., and my curiosity grew! Soon, I was diving into concepts like binary search, prefix sums, and hashing, learning how to implement them based on the problem’s requirements.&lt;/p&gt;

&lt;p&gt;But… it wasn’t as easy as it seemed. 🤯 Many problems needed slight tweaks in the concepts, and understanding the core requirement of each problem was tough. To tackle this, I started breaking down the sub-concepts, like applying Binary Search to find an answer or combining Prefix Sum with a Hash Table to solve certain subarray problems.&lt;/p&gt;

&lt;p&gt;Still, things didn’t fully click. Every time I encountered a new twist in a problem, I got puzzled again. 😅 That’s when I realized the importance of recognizing patterns. And this was a game-changer! 🎯 I started noticing that some problems consistently required Binary Search on the answer, while others needed Prefix Sum + Hash Table combos. By recognizing and applying these patterns, I found myself ahead of the curve! 🚀&lt;/p&gt;

&lt;p&gt;I applied the same approach to intermediate and advanced DSA concepts too. But here’s where it gets interesting — how solving DSA problems, recognizing patterns, and implementing concepts has impacted me.&lt;/p&gt;

&lt;p&gt;Now, I’m able to tackle almost any new problem that comes my way! 💪 Sure, some problems still stump me at first, but that’s usually because I’m not yet familiar with a particular pattern or concept.&lt;/p&gt;

&lt;p&gt;Solving this many DSA problems has given me deeper insights into how other technologies work, especially on the backend. It’s also sharpened my overall problem-solving skills since DSA is all about finding the most optimal way to solve a problem using the right data structures. And let’s be honest — big tech companies focus more on our problem-solving abilities rather than just subject matter expertise. 🧠&lt;/p&gt;

&lt;p&gt;I know I’ve solved more problems than most would consider necessary, but once I developed the problem-solver mindset, it was like I became possessed! 😂 Every time a problem came up, my brain would go into autopilot mode, and all I could think about was how to solve it in the most optimal way.&lt;/p&gt;

&lt;p&gt;So yes solving DSA with proper trick was truly a game changer for me 😃&lt;/p&gt;

&lt;h1&gt;
  
  
  Is Solving 1600 DSA Problems Really Necessary?
&lt;/h1&gt;

&lt;p&gt;Now, let’s get real — do you really need to solve 1600 DSA problems to succeed? The short answer is, not necessarily. 🤔&lt;/p&gt;

&lt;p&gt;While solving a large number of problems definitely helped me develop strong problem-solving skills and recognize patterns more quickly, it’s not about hitting a specific number. What’s most important is understanding the concepts deeply and being able to apply them effectively in different scenarios.&lt;/p&gt;

&lt;p&gt;For some people, solving 500 well-chosen problems might be enough to build the intuition they need. For others (like me 😅), solving a higher number just reinforces that problem-solver mindset. The key is to focus on quality — understanding how and why a solution works — rather than just aiming for a high number.&lt;/p&gt;

&lt;p&gt;At the end of the day, what truly matters is the ability to approach problems methodically and solve them optimally. Whether you do that by solving 200 or 1600 problems is up to you!&lt;/p&gt;

&lt;p&gt;Here is my Leetcode profile link 👉&lt;a href="https://leetcode.com/u/akshat0610/" rel="noopener noreferrer"&gt;https://leetcode.com/u/akshat0610/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you found my blog interesting please leave some 💙 and don’t forget to follow me 🤗&lt;/p&gt;

&lt;p&gt;Thankyou 💙&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>algorithms</category>
      <category>leetcode</category>
      <category>learning</category>
    </item>
    <item>
      <title>Top 10 System Designs || Interview Guide</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Fri, 04 Oct 2024 10:18:02 +0000</pubDate>
      <link>https://dev.to/akshat0610/top-10-system-designs-interview-guide-3fgf</link>
      <guid>https://dev.to/akshat0610/top-10-system-designs-interview-guide-3fgf</guid>
      <description>&lt;p&gt;Hey There 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 😃&lt;/p&gt;

&lt;p&gt;Whether you’re a fresher or an experienced software engineer, one thing is clear: cracking an SDE (Software Development Engineer) interview requires a solid understanding of System Design. In today’s tech-driven world, the ability to design complex systems and optimize them for scalability, efficiency, and reliability is a must-have skill.&lt;/p&gt;

&lt;p&gt;This blog is your guide to mastering the key system design concepts that will not only help you ace interviews but also equip you for real-world challenges. We’ll walk you through 10 essential system designs that are frequently asked in interviews, offering you practical insights and strategies. Whether you’re just starting or looking to sharpen your expertise, these exercises will provide you with the foundation you need to confidently discuss and design large-scale systems.&lt;/p&gt;

&lt;p&gt;Let’s dive in and start building your system design expertise!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ohxa5chjz917k2a18up.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ohxa5chjz917k2a18up.png" alt="Image description" width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  List of 10 Important System Designs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;URL Shortening Service&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A Messaging Service Like WhatsApp&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Instagram Feed Design&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Video Streaming Platfrom like YouTube , Netflix&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ride Sharing Service like Uber&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A Web Crawler like Google&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;An ECommerce System like Amazon&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Food Delievery Service Like Swiggy, Zomato&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Design Spotify&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Design File Sharing System like Dropbox&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was the list of 10 important system designs. A quick tip is follow latest updates and crahses of famous systems as they are more likely to be asked. Practice as much as possible to ace a system design interview.&lt;/p&gt;

&lt;p&gt;If you like my blog please follow me and don’t forget to leave some ❤&lt;/p&gt;

&lt;p&gt;Thankyou 💚&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>sde</category>
      <category>interview</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>864. Shortest Path to Get All Keys || Leetcode || Hard</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Wed, 25 Sep 2024 11:09:23 +0000</pubDate>
      <link>https://dev.to/akshat0610/864-shortest-path-to-get-all-keys-leetcode-hard-4c6k</link>
      <guid>https://dev.to/akshat0610/864-shortest-path-to-get-all-keys-leetcode-hard-4c6k</guid>
      <description>&lt;p&gt;Hey there 👋&lt;/p&gt;

&lt;p&gt;Hope you are doing well 😃&lt;/p&gt;

&lt;p&gt;In this blog we are going to discuss the approach for the Leetcode problem &lt;strong&gt;864.Shortest Path to Get All Keys&lt;/strong&gt;. We are going to understand the problem statement then we will try to build solution of the problem and finally we are going to code it.&lt;/p&gt;

&lt;p&gt;Link of problem -: &lt;a href="https://leetcode.com/problems/shortest-path-to-get-all-keys/description/" rel="noopener noreferrer"&gt;https://leetcode.com/problems/shortest-path-to-get-all-keys/description/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let’s get started 🔥&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpy43wyd25jfy01lk8ddk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpy43wyd25jfy01lk8ddk.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem Statement
&lt;/h2&gt;

&lt;p&gt;You are given an &lt;code&gt;m x n&lt;/code&gt; grid grid where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;'.' is an empty cell.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;'#' is a wall.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;'@' is the starting point.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lowercase letters represent keys.&lt;br&gt;
Uppercase letters represent locks.&lt;/p&gt;

&lt;p&gt;You start at the starting point and one move consists of walking one space in one of the four cardinal directions. You cannot walk outside the grid, or walk into a wall.&lt;/p&gt;

&lt;p&gt;If you walk over a key, you can pick it up and you cannot walk over a lock unless you have its corresponding key.&lt;/p&gt;

&lt;p&gt;For some &lt;code&gt;1 &amp;lt;= k &amp;lt;= 6&lt;/code&gt;, there is exactly one lowercase and one uppercase letter of the first k letters of the English alphabet in the grid. This means that there is exactly one key for each lock, and one lock for each key; and also that the letters used to represent the keys and locks were chosen in the same order as the English alphabet.&lt;/p&gt;

&lt;p&gt;Return the lowest number of moves to acquire all keys. If it is impossible, return &lt;code&gt;-1&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Example 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Input: grid = ["@.a..","###.#","b.A.B"]&lt;br&gt;
Output: 8&lt;br&gt;
Explanation: Note that the goal is to obtain all the keys not to open all &lt;br&gt;
the locks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Input: grid = ["&lt;a class="mentioned-user" href="https://dev.to/aa"&gt;@aa&lt;/a&gt;"]&lt;br&gt;
Output: -1&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem Explanation
&lt;/h2&gt;

&lt;p&gt;In the problem we are given a maze 𝄜 which consists of some locks 🔒and their corresponding keys 🔑, some walls 🧱 , empty spaces ▫ and a starting point @. The walls are denoted by ‘#’ . Keys are lowercase letters (‘a’ to ‘f’) and locks are uppercase letters corresponding to keys. Empty spaces are denoted by ‘.’ and starting point is denoted by ‘@’.&lt;/p&gt;

&lt;p&gt;Our task is to find all the keys in the minimum moves possible. We can’t go through a wall and if it not possible to collect all the keys then our answer will be -1.&lt;/p&gt;

&lt;p&gt;Now the question is how we can take moves such that we can collect all the keys and the moves are minimum? ❓&lt;/p&gt;

&lt;p&gt;To understand this let’s look at our Example 1 -:&lt;/p&gt;

&lt;p&gt;Input: grid = ["@.a..","###.#","b.A.B"]&lt;br&gt;
Output: 8&lt;br&gt;
Explanation: Note that the goal is to obtain all the keys not to open all &lt;br&gt;
the locks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi6etj8d2w3q8kf0peebg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi6etj8d2w3q8kf0peebg.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Now you can see that our guy 👨 starts from (0,0) and as per our problem he can move in four different directions &lt;strong&gt;&lt;em&gt;up&lt;/em&gt;&lt;/strong&gt;, &lt;em&gt;&lt;strong&gt;down&lt;/strong&gt;&lt;/em&gt;, &lt;em&gt;&lt;strong&gt;left&lt;/strong&gt;&lt;/em&gt; and &lt;strong&gt;&lt;em&gt;right&lt;/em&gt;&lt;/strong&gt;. We know that from (0,0) going in up and left direction is not possible 💁‍♂️ and he can’t go down as wall is there. So now he will just move in right direction. So his new position is (0,1). Now from this position again he can go in four different directions and &lt;strong&gt;these different paths are going to give him different answers and our concern is to get minimum out of these also he is not going to visit the cells he has come from&lt;/strong&gt; because this can make him go round about and he will never be able to get keys.&lt;br&gt;
So from (0,1) he will go to right cell (0,2), you know why 🙂.&lt;br&gt;
Now you can see that he finds a key 🔑 so he will simply keep it with himself and will move forward. Again he will go to right cell i.e. (0,3). From this cell he can either go right or he can go down. If he goes to right (0,4) now he can’t go anywhere, so going right will not give any answer to us.&lt;br&gt;
Let’s go down (1,3) and from here again he can go in four different directions.&lt;br&gt;
So doing this again and again will surely lead to our answer.&lt;/p&gt;

&lt;p&gt;But wait 😶, there’s a catch here it is not as easy as it seems here 🫨.&lt;/p&gt;

&lt;p&gt;You can see that from a given cell we are going on four different cells (four directions) and each cell is giving us a different answer because each cell leads to different path. Now this is very important statement here “each cell leads to different path”. Why? 🤔&lt;/p&gt;

&lt;p&gt;Suppose we have another grid -:&lt;br&gt;
grid=["@...a",".###A","b.BCc"]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkwsq8fno1fll474hc63f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkwsq8fno1fll474hc63f.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
So here we have two different paths possible from (0,0) one from right and other from down. And also we can take key ‘a’ in two different ways.&lt;br&gt;
One way is moving only in right direction from (0,0) and other path is ‘(0,0) -&amp;gt; (1,0) -&amp;gt; (2,0) -&amp;gt; (2,1) -&amp;gt; (2,0) -&amp;gt; (1,0) -&amp;gt; (0,0) -&amp;gt; (0,1) -&amp;gt; (0,2) -&amp;gt; (0,3) -&amp;gt; (0,4)’. Huh 😵? But we can’t trace the path we have visited before then how is this path possible 😵‍💫?&lt;/p&gt;

&lt;p&gt;The path is possible because while returning our guy has one more thing with him and that is the ‘bth key’ and hence this makes all the difference 🤯.&lt;br&gt;
Problem says to get all keys in minimum moves so following differnt paths will give us different number of moves and different number of keys.&lt;br&gt;
For example following the below path will give us answer -1.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhr6uqs01bia8cg19leud.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhr6uqs01bia8cg19leud.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
But following this path will give us 10 moves.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vx0amf8mvv8tgb68um1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vx0amf8mvv8tgb68um1.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
With each move guy’s position and keys he collected from a given path and total moves he took is associated. So this is why we are tracing back to the path which we followed earlier but this time with 1 key acquisition.&lt;/p&gt;

&lt;p&gt;So this was complete problem explanation. Now let’s head to solution of the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Now we know that the most important part of the problem is the state of each cell in path is (position,keys,steps). And our task is to find the minimum number of moves to collect all the keys.&lt;/p&gt;

&lt;p&gt;So we can use &lt;strong&gt;Breadth First Search&lt;/strong&gt; here. Why BFS?&lt;/p&gt;

&lt;p&gt;Because BFS sees all the possible cells of a given cell first before moving to next level and this ensures shortest path possible.&lt;/p&gt;

&lt;p&gt;We will make a queue that will contain {initial position of guy,keys he collected,total moves}. So for our example 1 the element in queue will be {0,0,0,0} (0th row, 0th column, bitmask for key, total moves).&lt;br&gt;
Now you might be wondering why we have taken bitmask here? 🤔&lt;/p&gt;

&lt;p&gt;Look at the problem carefully we have locks too of corresponding keys so using bitmask when we encounter a lock we can ensure that we have already collected the key related to that lock. &lt;strong&gt;So in short bitmask will help us in identifying which key we have collected so far.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So using queue we will see all the paths possible and will get answer when any one of the path gives us all the keys. 💁‍♂️&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3reyh61sc1mc9vxielw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3reyh61sc1mc9vxielw.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Here ’n’ denotes the number of rows in grid and ‘m’ denotes the number of columns in grid. Also ‘dir’ denotes the directions we can move in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd257m7ggywdkyj9i2ifk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd257m7ggywdkyj9i2ifk.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
So here I have defined a ‘vis’ vector it will keep track of visited path. Note that here we have stored position (row,col) and bitmask in visited array. We have taken size of this array as n*m*64. We have taken 64 because our bitmask can go upto 2⁶-1 as our keys are represented by 6 different letters.&lt;br&gt;
Then I traversed the grid to get the starting position of guy and total number of keys. After this I have made a queue in which I pushed starting position of guy, bit mask and total moves.&lt;/p&gt;

&lt;p&gt;`while(q.size() &amp;gt; 0)&lt;br&gt;
{&lt;br&gt;
     int row = q.front()[0];&lt;br&gt;
     int col = q.front()[1];&lt;br&gt;
     int mask = q.front()[2];&lt;br&gt;
     int steps = q.front()[3];&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; q.pop();

 int req_ans = pow(2,keys);
 if(mask == (req_ans-1)) return steps;

 for(int i = 0 ; i &amp;lt; dir.size() ; i++){
     int r = dir[i][0]; int c = dir[i][1];
     if(isValid(row+r,col+c) == true)
     {
          if(grid[row+r][col+c] == '.'){
               if(vis[row+r][col+c][mask] == false){
                    vis[row+r][col+c][mask] = true;
                    q.push({row+r,col+c,mask,steps+1});   
               }
          }
          else if(grid[row+r][col+c] == '#'){
               continue;
          }
          else if(grid[row+r][col+c] == '@'){
               if(vis[row+r][col+c][mask] == false){
                    vis[row+r][col+c][mask] = true;
                    q.push({row+r,col+c,mask,steps+1});   
               }
          }
          else if(grid[row+r][col+c] &amp;gt;= 'a' and grid[row+r][col+c] &amp;lt;= 'z'){
               if(vis[row+r][col+c][mask] == false){
                    vis[row+r][col+c][mask] = true;
                    int updated_mask = mask | (1 &amp;lt;&amp;lt; (grid[row+r][col+c]-'a'));
                    q.push({row+r,col+c,updated_mask,steps+1});    
               }
          }
          else{
               if(vis[row+r][col+c][mask] == false){
                   char lock = (grid[row+r][col+c]);
                   char key = tolower(lock);
                   int found = (mask &amp;amp; (1 &amp;lt;&amp;lt; (key - 'a'))); 
                   if(found &amp;gt; 0) q.push({row+r,col+c,mask,steps+1});   

                   vis[row+r][col+c][mask] = true;
               } 
          } 
     }
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}`&lt;br&gt;
Here we have our code for BFS. We take the front entry of queue if this entry has all keys then we return the steps. Otherwise we go in different directions. Now going in different directions can possibly lead us to a wall, empty space, lock, key or out of grid. So we have to check each of the case. Also we need to ensure that the next state we are visiting is not seen before.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When we encounter a lock we will check our bitmask is having its key or not. If present we will push this entry in queue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When we encounter a key we will update our mask and we will push this entry in our queue.&lt;br&gt;
Note that following the steps we can visit some cells again but these cells must have different state.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2mg9iede3irkllc87tae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2mg9iede3irkllc87tae.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check complete code here -: &lt;a href="https://github.com/akshatsh0610/Data-Structures-and-Algorithms-Problems-Solution/tree/main/Leetcode%20Problems/Breadth%20First%20Search" rel="noopener noreferrer"&gt;https://github.com/akshatsh0610/Data-Structures-and-Algorithms-Problems-Solution/tree/main/Leetcode%20Problems/Breadth%20First%20Search&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Using BFS and bit manipulation we can easily solve this problem. We need to make sure the state of each path to get correct answer.&lt;/p&gt;

&lt;p&gt;I hope you have understood it well. For more follow me and don’t forget to leave some reactions.&lt;/p&gt;

&lt;p&gt;Thankyou 💚&lt;/p&gt;

</description>
      <category>leetcode</category>
      <category>dsa</category>
      <category>bfs</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Beginner's AID|| A Data Structures and Algorithms Guide || Get Interview Ready</title>
      <dc:creator>Akshat Sharma</dc:creator>
      <pubDate>Sat, 21 Sep 2024 06:26:51 +0000</pubDate>
      <link>https://dev.to/akshat0610/beginners-aid-a-data-structures-and-algorithms-guide-get-interview-ready-1iga</link>
      <guid>https://dev.to/akshat0610/beginners-aid-a-data-structures-and-algorithms-guide-get-interview-ready-1iga</guid>
      <description>&lt;p&gt;Hey there! 👋&lt;br&gt;
Hope you’re doing great! 😃&lt;/p&gt;

&lt;p&gt;So, you’ve probably heard a ton of people talking about cracking interviews at big companies (whether it’s an MNC or a startup), right? It takes some serious prep and dedication. And there’s this one thing that everyone seems to bring up over and over: &lt;strong&gt;Data Structures and Algorithms **— or, as the cool kids call it, **DSA&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;DSA isn’t just another topic you can gloss over. It’s the foundation that you need to build if you want to nail those interviews and land that dream job! 🚀 But don’t worry — I’m here to guide you through the maze.&lt;/p&gt;

&lt;p&gt;In this blog, we’re going to talk about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How to kick off your DSA journey.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The roadmap you’ll follow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The best platforms to practice on&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some other important stuff you should know along the way.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, buckle up, and let’s dive into the world of DSA! 🔥&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa95o8y1qrj7gwnzfhbl9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa95o8y1qrj7gwnzfhbl9.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to get started with DSA?
&lt;/h2&gt;

&lt;p&gt;Before diving into the topic, it's crucial to understand what DSA actually is and why it's so important. Let me give you a quick breakdown of these two key questions!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is DSA?&lt;/strong&gt;&lt;br&gt;
DSA is an acronym for Data Strcutures and Algorithms. It is a fundamental part of Computer Science that teaches you how to think and solve complex problems systematically. Using the right data structure and algorithm makes your program run faster, especially when working with lots of data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why DSA is important?&lt;/strong&gt;&lt;br&gt;
Here's why you must get a grip on DSA:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Problem Solving: Companies love to test your problem-solving skills, and DSA is the toolkit that helps you solve problems effectively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Efficiency: Knowing DSA allows you to write code that's not just correct but also fast and scalable. This is what top companies expect from you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Interview Cracker: Almost all tech interviews focus on DSA. So, mastering it means increasing your chances of cracking interviews at big tech companies like Google, Amazon, or startups.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build Strong Foundations: Once you get DSA down, other advanced topics like system design, AI, or machine learning become easier to grasp.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Simply put, DSA isn't just about cracking interviews - it's about becoming a better coder! 🚀&lt;br&gt;
Now that we know what it is and why it's so important, let's dive deeper into how to get started with it! 🔥&lt;br&gt;
One of the first questions that pops into everyone's mind is: &lt;strong&gt;Which programming language should I use for DSA? 🤔&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Language Choice for DSA&lt;/strong&gt;&lt;br&gt;
Honestly? You can pick any language you're comfortable with! (Just don't go thinking you can use a styling or markup language like HTML/CSS! 😆). Whether it's Java, C++, Python, Go, R, or any other programming language you're familiar with - they all work just fine for DSA. The key is to choose one that you have a good grip on so you can focus on the algorithms, not the syntax.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resources for Studying DSA&lt;/strong&gt;&lt;br&gt;
Next question: &lt;strong&gt;Where can I study DSA?&lt;/strong&gt;&lt;br&gt;
Luckily, finding resources is easier than ever. With 4 out of 5 tech creators teaching DSA these days, you'll find plenty of content online. You can access:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;YouTube playlists with step-by-step tutorials.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Websites offering comprehensive guides.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Courses that take you from beginner to pro.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are a few solid resources to get you started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;W3Schools DSA &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GeeksforGeeks DSA Tutorial&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Striver's A2Z DSA Course Sheet&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are great starting points for beginners looking to build a strong foundation in DSA! 🎯&lt;br&gt;
With the right language and resources, you're all set to begin your journey. Let's keep moving forward! 🔥&lt;/p&gt;

&lt;h2&gt;
  
  
  Roadmap for DSA
&lt;/h2&gt;

&lt;p&gt;So, you've chosen your programming language and gathered your resources. Now it's time to follow a well-structured roadmap to master DSA! 🎯&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. First Things First: Master the Programming Basics&lt;/strong&gt;&lt;br&gt;
Before you even think about diving into DSA, you need a solid understanding of basic programming concepts. Make sure you're comfortable with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Operators&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Input/Output&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conditionals&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Loops&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If these concepts aren't second nature to you, you might find yourself in big trouble! 😨 So, my advice? Study the fundamentals of programming first before jumping into DSA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Start with Basic Programs and Concepts&lt;/strong&gt;&lt;br&gt;
Now that you're comfortable with the basics, it's time to get your hands dirty with some simple programs. Start with tasks like performing arithmetic operations, playing with loops, and working with conditionals. You should also learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Bit Manipulations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Structures and Classes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Recursion (yes, recursion can feel like a beginner's worst nightmare 💀, but trust me, you'll get the hang of it!)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you've nailed these, you're ready to dive deeper into the world of DSA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Get Familiar with Basic Data Structures&lt;/strong&gt;&lt;br&gt;
Now comes the fun part: Data Structures! Start with the basic ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Arrays&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linked Lists&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stacks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Queues&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strings (an array of characters)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understand each data structure thoroughly and solve plenty of practice problems to get comfortable with them.&lt;br&gt;
Once you've got these down, it's time to learn about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Hash Tables (Maps)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sets&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bit Manipulations&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should also tackle some basic algorithms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sorting Algorithms: Bubble, Selection, Insertion, Quick Sort, Merge Sort, Heap Sort, Count Sort, Radix Sort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Searching Algorithms: Linear Search, Binary Search.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Other Key Concepts: Prefix Sum, Sliding Window, Two-pointer technique, and Greedy algorithms.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Unlock the Power of Data Structures&lt;/strong&gt;&lt;br&gt;
As you dive deeper into DSA, you'll notice each data structure comes with unique concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Monotonic Stacks (essential for certain problems).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Queues for implementing Breadth-First Search (BFS).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linked Lists for designing more advanced systems.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Level Up: Non-Linear Data Structures&lt;/strong&gt;&lt;br&gt;
Congratulations, you've moved past the beginner stage! Now it's time to prepare for non-linear data structures - but start slow. Focus on Trees first (don't jump to Graphs just yet).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Learn about Binary Trees and Binary Search Trees.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Understand Tree Traversal Algorithms (Inorder, Preorder, Postorder).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Practice Tree Manipulations like insertions, deletions, and modifications.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Get Ready for Advanced Stuff: Dynamic Programming (DP) 😈&lt;/strong&gt;&lt;br&gt;
Before diving into Dynamic Programming, you need to be super comfortable with Recursion and Backtracking. These concepts are at the core of DP. Make sure to practice them as much as possible.&lt;br&gt;
Here are some classic DP problems that pop up in nearly every interview:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;0/1 Knapsack Problem&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Longest Common Subsequence &amp;amp; Substring&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fibonacci Series&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Jump Game (multiple variations)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Best Time to Buy and Sell Stock (multiple variations)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stone Game (multiple variations)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Russian Dolls (a classic DP + Binary Search problem)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Matrix Chain Multiplication&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kadane's Algorithm (for maximum subarray problems)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By now, you're officially at the intermediate level in DSA! 💪 You're ready to crack those interviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Going Beyond: Advanced Data Structures &amp;amp; Concepts&lt;/strong&gt;&lt;br&gt;
If you've come this far, you're ready to tackle more advanced topics. These will take your DSA skills to the next level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Graphs: Depth-First Search (DFS), Breadth-First Search (BFS), Shortest Path Algorithms (Dijkstra, Bellman-Ford).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tries: Useful for word problems and prefix matching.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Segment Trees &amp;amp; Fenwick Trees: For range queries and dynamic data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advanced Algorithms: String Matching (KMP, Z algorithm), Union-Find, and advanced combinatorics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Number Theory: Crucial for competitive programming, covering GCD, LCM, Modular Arithmetic, etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're looking to get into Competitive Programming, you'll need a deep understanding of number theory and advanced algorithms. But don't worry - you'll get there with time and practice!&lt;/p&gt;

&lt;p&gt;By following this roadmap and putting in consistent effort, you're well on your way to becoming a DSA master! Whether you're aiming to crack interviews or dive into competitive programming, you're now equipped with the knowledge to level up your skills. Keep practicing, and remember: persistence is key! 🔥&lt;/p&gt;

&lt;h2&gt;
  
  
  Important Platforms
&lt;/h2&gt;

&lt;p&gt;Now that you have a perfect roadmap. You have to make yourself aware of certain platforms where you can practice different DSA problems.&lt;/p&gt;

&lt;p&gt;The platforms that I prefer for praticing problems are -:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.geeksforgeeks.org/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://leetcode.com/" rel="noopener noreferrer"&gt;https://leetcode.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.lintcode.com/" rel="noopener noreferrer"&gt;https://www.lintcode.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.hackerrank.com/about-us/home/" rel="noopener noreferrer"&gt;https://www.hackerrank.com/about-us/home/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are very beginner friendly platforms and they contain problems asked by all big tech giants and advanced problems too.&lt;br&gt;
There are other platforms too.&lt;/p&gt;

&lt;p&gt;For competetive programming -:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://codeforces.com/" rel="noopener noreferrer"&gt;https://codeforces.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.codechef.com/" rel="noopener noreferrer"&gt;https://www.codechef.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.hackerearth.com/getstarted-competitive-programming/" rel="noopener noreferrer"&gt;https://www.hackerearth.com/getstarted-competitive-programming/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Other important stuff
&lt;/h2&gt;

&lt;p&gt;So now that you've got your resources, roadmap, and list of platforms, you're all set for your DSA journey! 🚀&lt;/p&gt;

&lt;p&gt;A little suggestion - try practicing DSA with one or two friends. It adds a fun, competitive spark to your learning and keeps the motivation high. You'll be surprised how much faster you can improve when you're learning together and challenging each other!&lt;/p&gt;

&lt;p&gt;And that's really all you need. You've got the tools, the plan, and the determination. Now go and crush it! 💥&lt;/p&gt;

&lt;p&gt;I hope you find this helpful and resourceful.&lt;/p&gt;

&lt;p&gt;Thank you and good luck on your journey! 💛&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>beginners</category>
      <category>interview</category>
      <category>leetcode</category>
    </item>
  </channel>
</rss>
