<?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: Nadeem Akhtar</title>
    <description>The latest articles on DEV Community by Nadeem Akhtar (@nadeem_akhtar_5b94eaa5f5e).</description>
    <link>https://dev.to/nadeem_akhtar_5b94eaa5f5e</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%2F3216723%2F0dda87b9-4f07-4cef-8817-f67a6a293880.png</url>
      <title>DEV Community: Nadeem Akhtar</title>
      <link>https://dev.to/nadeem_akhtar_5b94eaa5f5e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nadeem_akhtar_5b94eaa5f5e"/>
    <language>en</language>
    <item>
      <title>SQL Vs NOSQL</title>
      <dc:creator>Nadeem Akhtar</dc:creator>
      <pubDate>Wed, 04 Jun 2025 16:07:31 +0000</pubDate>
      <link>https://dev.to/nadeem_akhtar_5b94eaa5f5e/sql-vs-nosql-1kcf</link>
      <guid>https://dev.to/nadeem_akhtar_5b94eaa5f5e/sql-vs-nosql-1kcf</guid>
      <description>&lt;h1&gt;
  
  
  🧠 SQL vs NoSQL – What’s the Difference?
&lt;/h1&gt;

&lt;p&gt;When we build websites or apps, we need a place to &lt;strong&gt;store data&lt;/strong&gt;. That place is called a &lt;strong&gt;database&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
There are two main types: &lt;strong&gt;SQL&lt;/strong&gt; and &lt;strong&gt;NoSQL&lt;/strong&gt;. Let’s understand both in simple words.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ What is SQL?
&lt;/h2&gt;

&lt;p&gt;SQL stands for &lt;strong&gt;Structured Query Language&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
It stores data in a table format – like an Excel sheet with &lt;strong&gt;rows and columns&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixed structure – all data must follow the same format
&lt;/li&gt;
&lt;li&gt;Good for organized and clean data
&lt;/li&gt;
&lt;li&gt;You can run complex queries to get reports
&lt;/li&gt;
&lt;li&gt;It is &lt;strong&gt;vertically scalable&lt;/strong&gt; (means: you can increase CPU or RAM of one server)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt; MySQL, PostgreSQL, Oracle&lt;/p&gt;

&lt;h3&gt;
  
  
  🧾 Example SQL Table:
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;item_id&lt;/th&gt;
&lt;th&gt;item_name&lt;/th&gt;
&lt;th&gt;category&lt;/th&gt;
&lt;th&gt;price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Hamburger&lt;/td&gt;
&lt;td&gt;American&lt;/td&gt;
&lt;td&gt;299&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;French Fries&lt;/td&gt;
&lt;td&gt;American&lt;/td&gt;
&lt;td&gt;150&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Pasta&lt;/td&gt;
&lt;td&gt;Italian&lt;/td&gt;
&lt;td&gt;250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Biryani&lt;/td&gt;
&lt;td&gt;Indian&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  ✅ What is NoSQL?
&lt;/h2&gt;

&lt;p&gt;NoSQL means &lt;strong&gt;Not Only SQL&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
It stores data in a flexible format – like &lt;strong&gt;JSON&lt;/strong&gt; (key-value pairs).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No fixed structure – every item can have different fields
&lt;/li&gt;
&lt;li&gt;Best for real-time, fast-changing data
&lt;/li&gt;
&lt;li&gt;It is &lt;strong&gt;horizontally scalable&lt;/strong&gt; (means: data is spread across many servers)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt; MongoDB, Firebase, Cassandra&lt;/p&gt;

&lt;h3&gt;
  
  
  🧾 Example NoSQL Data:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"userId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Buy Groceries"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🛒 Real-Life Examples&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Flipkart – E-commerce Website
Flipkart has many types of products: electronics, clothes, kitchen items.
Each product needs different data fields:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Electronics: RAM, storage, processor&lt;/p&gt;

&lt;p&gt;Clothing: size, fabric, color&lt;/p&gt;

&lt;p&gt;Kitchen items: weight, material&lt;/p&gt;

&lt;p&gt;SQL needs same format for all products, which is difficult here.&lt;br&gt;
So, Flipkart uses NoSQL for product data.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Netflix – Streaming Platform
Netflix uses both SQL and NoSQL:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;✅ SQL for fixed data like movie title, release date&lt;/p&gt;

&lt;p&gt;🔄 NoSQL for user recommendations (every user sees different content)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Uber – Ride Sharing App
Uber data keeps changing in real-time (cab location, ride status).
Also, they keep adding new features like Uber Pool, Share Ride.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, Uber uses NoSQL – because it’s fast and flexible.&lt;/p&gt;

&lt;p&gt;🧭 When to Use SQL vs NoSQL?&lt;br&gt;
Use SQL when:   Use NoSQL when:&lt;br&gt;
✅ Your data is structured 🔄 Your data is unstructured or flexible&lt;br&gt;
🧠 You need complex reports   ⚡ You need speed and real-time updates&lt;br&gt;
📊 Data format doesn’t change much  🌍 You want to scale across many servers&lt;/p&gt;

&lt;p&gt;🎯 Conclusion&lt;br&gt;
SQL is great for structured and clean data (like banking or employee records)&lt;/p&gt;

&lt;p&gt;NoSQL is best for flexible, fast, and real-time apps (like e-commerce, streaming, ride-sharing)&lt;/p&gt;

&lt;p&gt;Most big companies use both, based on the need.&lt;/p&gt;

&lt;p&gt;💡 Know when to use what — and you’ll build faster, smarter apps!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Functions</title>
      <dc:creator>Nadeem Akhtar</dc:creator>
      <pubDate>Wed, 28 May 2025 06:08:20 +0000</pubDate>
      <link>https://dev.to/nadeem_akhtar_5b94eaa5f5e/function-224f</link>
      <guid>https://dev.to/nadeem_akhtar_5b94eaa5f5e/function-224f</guid>
      <description>&lt;p&gt;&lt;strong&gt;3 Ways to Create Functions in JavaScript&lt;/strong&gt;&lt;br&gt;
There are three ways to create functions in JavaScript:&lt;/p&gt;

&lt;p&gt;1.Plain or Normal Function&lt;br&gt;
2.Function Expression (function without a name stored in a variable)&lt;br&gt;
3.Arrow Function (can be written in implicit or explicit style and can return objects)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Normal Function
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function sayMyName() {   // `()` inside is called parameters
  console.log("Sam");
}

sayMyName;   // This is a reference to the function, but it does NOT run it
sayMyName(); // This calls the function and runs it

// Output: Sam
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Function Expression
This is a function without a name stored in a variable.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const showNum = function(a) {
  return a;
}

console.log(showNum(5)); // Output: 5
console.log(showNum());  // Output: undefined, because no argument was passed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Arrow Function
Arrow functions can be written in two ways:
a) Implicit Return (no need to write return keyword)
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const addNum = (a, b) =&amp;gt; a + b;
console.log(addNum(2, 3)); // Output: 5
console.log(addNum());      // Output: NaN (because no arguments passed)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You can also use parentheses for returning an object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const addNumTwo = (a, b) =&amp;gt; (a + b);
console.log(addNumTwo(3, 4)); // Output: 7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;b) Explicit Return (use return keyword inside braces)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const addNumOne = (a, b) =&amp;gt; {
  return a + b;
}

const result = addNumOne(2, 3);
console.log(result); // Output: 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arrow Function Returning Objects&lt;br&gt;
You can use arrow functions to return objects like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const result = (str) =&amp;gt; ({ length: str.length, uppercase: str.toUpperCase() });
console.log(result("hello")); 
// Output: { length: 5, uppercase: "HELLO" }

const analyzeSentence = sentence =&amp;gt; ({ wordCount: sentence.split(" ").length });
console.log(analyzeSentence("JavaScript is fun"));
// Output: { wordCount: 3 }

const calculateSquareAndCube = (num) =&amp;gt; ({ square: num ** 2, cube: num ** 3 });
console.log(calculateSquareAndCube(4));
// Output: { square: 16, cube: 64 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More Arrow Function Examples (with explicit return)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sum of Array Elements
const arr = [1, 2, 3, 4, 5];
const sumOfArr = (arr) =&amp;gt; {
  let sum = 0;
  for (let i = 0; i &amp;lt; arr.length; i++) {
    sum += arr[i];
  }
  return sum;
}

console.log(sumOfArr(arr)); // Output: 15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reverse a String&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const reverse = (str) =&amp;gt; {
  let rev = "";
  for (let i = str.length - 1; i &amp;gt;= 0; i--) {
    rev += str[i];
  }
  return rev;
}

console.log(reverse("hello")); // Output: olleh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
