<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tanmay wadibhasme on Medium]]></title>
        <description><![CDATA[Stories by Tanmay wadibhasme on Medium]]></description>
        <link>https://medium.com/@wadibhasmetanmay605?source=rss-acad9cc0e2b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uCYVRjVWEoZQttwVgMlpUg.png</url>
            <title>Stories by Tanmay wadibhasme on Medium</title>
            <link>https://medium.com/@wadibhasmetanmay605?source=rss-acad9cc0e2b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:09:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wadibhasmetanmay605/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Exploring SonarQube for IDE in IntelliJ IDEA]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/exploring-sonarqube-for-ide-in-intellij-idea-30f0fa8ad568?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/30f0fa8ad568</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[intelije-ide]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[sonarqube]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Tue, 19 May 2026 05:48:01 GMT</pubDate>
            <atom:updated>2026-05-19T05:48:01.549Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbG9rfEZEk7OQ3m6WdMRyw.png" /></figure><p>As a Java/Spring Boot developer, writing code is only one part of development. Maintaining clean, secure, and reliable code is equally important. Recently, I explored <strong>SonarQube for IDE</strong> in IntelliJ IDEA to understand how it helps improve code quality during development.</p><h3>What is SonarQube for IDE?</h3><p>SonarQube for IDE is an IntelliJ plugin that analyzes code in real time and highlights issues related to:</p><ul><li>Maintainability</li><li>Reliability</li><li>Vulnerabilities</li><li>Security Hotspots</li><li>Code Smells</li></ul><p>It helps developers detect problems early before pushing code to production.</p><p>Official Website: <a href="https://docs.sonarsource.com/sonarqube-for-intellij">https://www.sonarsource.com/products/sonarqube/ide/</a></p><h3>Installation in IntelliJ IDEA</h3><p>The plugin can be installed directly from the IntelliJ Marketplace.</p><p>Steps:</p><pre>File<br>→ Settings<br>→ Plugins<br>→ Marketplace<br>→ Search “SonarQube for IDE”<br>→ Install<br>→ Restart IntelliJ</pre><p>After installation, the plugin starts analyzing code automatically.</p><h3>Feature I Explored: “Focus on New Code”</h3><p>One feature I found very useful was the <strong>Focus on New Code</strong> section.</p><p>By default, SonarQube treats recently modified code as “<a href="https://docs.sonarsource.com/sonarqube-for-intellij/using/new-code"><strong><em>New Code</em></strong></a>”. In my case, it showed changes from the last 30 days.</p><p>This helps developers focus only on:</p><ul><li>recently added code</li><li>modified files</li><li>newly introduced issues</li></ul><p>instead of reviewing the entire old codebase.</p><p>This approach is very useful in large projects where analyzing the whole application can become difficult.</p><h3>Issues Detected During Exploration</h3><p>While exploring the plugin, I observed different categories of issues.</p><h3>1. Maintainability Issues</h3><p>These issues affect code readability and long-term maintenance.</p><p>Examples:</p><ul><li>generic exception usage</li><li>unnecessary complexity</li><li>duplicate logic</li><li>poor resource handling</li></ul><p>Example:</p><pre>throw new RuntimeException(&quot;Invalid file&quot;);</pre><p>Better approach:</p><pre>throw new IllegalArgumentException(&quot;Invalid file&quot;);</pre><h3>2. Reliability Risks</h3><p>These are potential bugs that may cause failures at runtime.</p><p>Examples:</p><ul><li>possible null pointer exceptions</li><li>resource leaks</li><li>unreachable code</li></ul><p>Example:</p><pre>InputStream stream = file.getInputStream();</pre><p>Recommended improvement:</p><pre>try (InputStream stream = file.getInputStream()) {<br>}</pre><h3>3. Vulnerabilities &amp; Security Hotspots</h3><p>SonarQube also identifies risky areas related to application security.</p><p>Examples:</p><ul><li>unsafe SQL queries</li><li>insecure file handling</li><li>sensitive operations requiring manual review</li></ul><p>This is especially useful in backend applications handling:</p><ul><li>authentication</li><li>file uploads</li><li>database operations</li></ul><h3>Logging Improvement Example</h3><p>One issue highlighted during analysis was related to logging style.</p><p>Before:</p><pre>LOGGER.info(&quot;Path=&quot; + path);</pre><p>Recommended:</p><pre>LOGGER.info(&quot;Path={}&quot;, path);</pre><p>This improves performance and follows better logging practices.</p><h3>Benefits I Observed</h3><p>After exploring SonarQube for IDE, I found these major benefits:</p><ul><li>Real-time code quality analysis</li><li>Early issue detection</li><li>Better clean coding practices</li><li>Improved maintainability</li><li>Increased awareness of security risks</li><li>Reduced technical debt</li></ul><p>It works like an additional quality layer while coding.</p><h3>My Learning Experience</h3><p>As someone working with Spring Boot backend development, I found SonarQube particularly useful for:</p><ul><li>exception handling</li><li>file upload APIs</li><li>logging improvements</li><li>resource management</li><li>writing cleaner service code</li></ul><p>The “Focus on New Code” feature was especially helpful because it allowed me to review only recent changes instead of the full project.</p><h3>Conclusion</h3><p>Exploring SonarQube for IDE helped me understand how professional tools improve software quality during development itself.</p><p>It is not just about fixing errors — it also encourages:</p><ul><li>cleaner code</li><li>safer implementations</li><li>better maintainability</li><li>production-level coding practices</li></ul><p>For Java and Spring Boot developers, SonarQube for IDE can be a very useful tool for continuously improving code quality while developing applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30f0fa8ad568" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating React Apps (CRA, Vite, Specific Versions, Tailwind CSS)]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/creating-react-apps-cra-vite-specific-versions-tailwind-css-862e5f6b0afc?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/862e5f6b0afc</guid>
            <category><![CDATA[react-setup]]></category>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Fri, 21 Nov 2025 09:23:52 GMT</pubDate>
            <atom:updated>2025-11-21T09:23:52.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Egj_x4SZW_-2AulTizq4uw.png" /></figure><h3>1. Create React App using CRA (create-react-app)</h3><h3>Commands:</h3><pre>npx create-react-app my-app<br>cd my-app<br>npm start</pre><h3>What this does:</h3><ul><li>Sets up React with Webpack &amp; Babel automatically.</li><li>Starts dev server on <a href="http://localhost:3000/"><strong>http://localhost:3000</strong></a>.</li></ul><h3>2. Create React App using Vite (Modern &amp; Fast)</h3><h3>Commands:</h3><pre>npm create vite@latest my-app -- --template react<br>cd my-app<br>npm install<br>npm run dev</pre><h3>What this does:</h3><ul><li>Creates a lightweight &amp; very fast React project.</li><li>Starts dev server on <a href="http://localhost:5173/"><strong>http://localhost:5173</strong></a>.</li></ul><h3>3. Create React App with a Specific React Version (Example: 18.3.0)</h3><h3>Steps:</h3><ol><li>First create a Vite project:</li></ol><pre>npm create vite@latest my-app -- --template react<br>cd my-app</pre><p>2. Install specific version:</p><pre>npm install react@18.3.0 react-dom@18.3.0</pre><p>3. Start app:</p><pre>npm install<br>npm run dev</pre><h3>4. Remove a Package (React Example)</h3><h3>Command:</h3><pre>npm uninstall react react-dom</pre><p>Optional Cleanup:</p><pre>rm -rf node_modules<br>rm package-lock.json<br>npm install</pre><h3>5. Integrate Tailwind CSS with Vite + React (Latest Official Method)</h3><p>Tailwind CSS now recommends installing Tailwind as a <strong>Vite plugin</strong> for React, Vue, Laravel, SvelteKit, SolidJS, etc.</p><h3>01 — Create your Vite project</h3><pre>npm create vite@latest my-project<br>cd my-project</pre><h3>02 — Install Tailwind CSS (new plugin method)</h3><pre>npm install tailwindcss @tailwindcss/vite</pre><h3>03 — Configure the Tailwind Vite plugin</h3><p>Edit vite.config.js or vite.config.ts:</p><pre>import { defineConfig } from &#39;vite&#39;<br>import tailwindcss from &#39;@tailwindcss/vite&#39;<br>export default defineConfig({<br>plugins: [<br>tailwindcss(),<br>],<br>})</pre><h3>04 — Import Tailwind CSS</h3><p>In your main CSS file (e.g., src/style.css or src/index.css):</p><pre>@import &quot;tailwindcss&quot;;</pre><blockquote><em>No need for </em><em>@tailwind base; @tailwind components; @tailwind utilities; in the new plugin version.</em></blockquote><h3>05 — Start the development server</h3><pre>npm run dev</pre><h3>06 — Use Tailwind in your HTML / JSX</h3><p>Make sure your compiled CSS is included.</p><p>Example:</p><pre>&lt;!doctype html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;meta charset=&quot;UTF-8&quot;&gt;<br>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>&lt;link href=&quot;/src/style.css&quot; rel=&quot;stylesheet&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1 class=&quot;text-3xl font-bold underline&quot;&gt;<br>Hello world!<br>&lt;/h1&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>6. Folder Structure of Vite React App</h3><pre>my-app/<br>├─ index.html<br>├─ package.json<br>├─ vite.config.js<br> ├─ src/<br> │ ├─ App.jsx<br> │ ├─ main.jsx<br> │ └─ index.css</pre><h3>7. Conclusion</h3><p>This blog covers:</p><ul><li>Creating a React app using Create React App (CRA)</li><li>Creating a React app using Vite</li><li>Installing specific React versions</li><li>Removing packages</li><li>Adding Tailwind CSS into Vite React App</li></ul><p>This is a perfect guide for beginners and developers moving to modern setup like Vite.</p><h3>6. Folder Structure of Vite React App</h3><pre>my-app/<br>├─ index.html<br>├─ package.json<br>├─ vite.config.js<br>├─ src/<br>│  ├─ App.jsx<br>│  ├─ main.jsx<br>│  └─ index.css</pre><h3>7. Conclusion</h3><p>This blog covers:</p><ul><li>Creating a React app using Create React App (CRA)</li><li>Creating a React app using Vite</li><li>Installing specific React versions</li><li>Removing packages</li><li>Adding Tailwind CSS into Vite React App</li></ul><p>This is a perfect guide for beginners and developers moving to modern setup like Vite.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=862e5f6b0afc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 1: JavaScript Fundamentals: From Variable Declarations to Data Types (with Real-Time Use…]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/day-1-javascript-fundamentals-from-variable-declarations-to-data-types-with-real-time-use-caffe25df0bf?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/caffe25df0bf</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[scripting]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Wed, 23 Jul 2025 16:47:10 GMT</pubDate>
            <atom:updated>2025-07-23T19:33:52.177Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Day 1: JavaScript Fundamentals: From Variable Declarations to Data Types (with Real-Time Use Cases)</h3><p>👤 <em>Author: Tanmay Wadibhasme</em><br> 🗓️ <em>Learning Phase: JS Foundations (up to Function Declarations)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zkmnj0idQyJajQb-KnrpEA.png" /></figure><h3>📍 Introduction</h3><p>As I continue learning JavaScript, I’m documenting the <strong>core concepts</strong> I’ve explored so far — not just theoretically, but in a way that makes sense <strong>for real-world development</strong> and <strong>interview preparation</strong>.</p><p>This blog is a combination of:</p><ul><li>🧠 Concepts</li><li>💡 Real-time examples</li><li>✅ Use cases</li><li>🎯 Spoken-style explanations</li></ul><h3>🔹 1. var, let, and const – What’s the Difference?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAXY7-4cdkttVLRNnvshRA.png" /></figure><h3>❌ Why Avoid var?</h3><ul><li>It’s <strong>function-scoped</strong>, not block-scoped</li><li>Allows <strong>re-declaration</strong> — can overwrite values silently</li><li>Can lead to <strong>unexpected bugs</strong></li><li>It behaves strangely due to <strong>hoisting</strong></li></ul><h3>✅ Use:</h3><ul><li>let → for values that change</li><li>const → for fixed values like config or object references</li></ul><h3>🔹 2. What is Hoisting in JavaScript?</h3><p>🧠 <strong>Definition:</strong></p><blockquote><em>Hoisting is JavaScript’s default behavior of </em><strong><em>moving variable and function declarations to the top of their scope</em></strong><em> before the code is executed.</em></blockquote><p>But only <strong>declarations</strong> are hoisted — <strong>initializations are not</strong>.</p><h3>💡 Real-World Analogy (Spoken Style):</h3><blockquote><em>“Think of hoisting like this:<br> You’re reading instructions before assembling furniture.<br> JavaScript looks through the code </em><strong><em>first</em></strong><em>, remembers all your variable </em><strong><em>names</em></strong><em>, then starts executing line by line.<br> So if you try to use something before it’s fully set up — it might give </em><strong><em>undefined</em></strong><em>, or crash.”</em></blockquote><h3>🔍 Example with var (Allowed but risky):</h3><pre>console.log(score); // undefined<br>var score = 100;</pre><p>JS hoists the declaration: var score;, but not the assignment. So output = undefined.</p><h3>🔥 Example with let or const (TDZ - throws error):</h3><pre>console.log(age); // ❌ ReferenceError<br>let age = 25;</pre><pre>console.log(pi); // ❌ ReferenceError<br>const pi = 3.14;</pre><h3>✅ Function Hoisting</h3><pre>greet(); // ✅ Works<br>function greet() {<br>  console.log(&quot;Hello Tanmay!&quot;);<br>}</pre><h3>❌ Function Expression is not hoisted</h3><pre>sayHello(); // ❌ TypeError<br>var sayHello = function () {<br>  console.log(&quot;Hi!&quot;);<br>};</pre><h3>🎯 Summary:</h3><blockquote><em>“var is hoisted with </em><em>undefined, </em><em>let and </em><em>const are hoisted into the </em><strong><em>Temporal Dead Zone</em></strong><em>, and function declarations are hoisted fully.&quot;</em></blockquote><h3>🔹 3. JavaScript Data Types with Use Cases</h3><h3>✅ Primitive Types (7 total):</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L9jD4vuOM95QHlkX3bRQLw.png" /></figure><p>🔶 Non-Primitive Types (Reference Types)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*ABkXgTydlyiTWAEfJMKrew.png" /></figure><h3>🔹 4. typeof – Checking the Type</h3><pre>typeof &quot;Hello&quot;         // &quot;string&quot;<br>typeof 123             // &quot;number&quot;<br>typeof true            // &quot;boolean&quot;<br>typeof undefined       // &quot;undefined&quot;<br>typeof null            // ❌ &quot;object&quot; (JavaScript bug)<br>typeof Symbol()        // &quot;symbol&quot;<br>typeof [1,2,3]         // &quot;object&quot;<br>typeof {name: &quot;A&quot;}     // &quot;object&quot;</pre><h3>🔹 5. Strict vs Loose Equality (=== vs ==)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiA7-jPWcngzc76UxcKfzA.png" /></figure><p>🎯 <strong>Best Practice:</strong> Always use === to avoid unexpected results.</p><h3>🔹 6. Operators in JavaScript</h3><h3>➕ Arithmetic Operators</h3><p>Used to perform basic mathematical operations.</p><pre>+  -  *  /  %  **  ++  --</pre><h3>⚖️ Comparison Operators</h3><p>Compare two values and return a boolean result.</p><pre>==   ===   !=   !==   &gt;   &gt;=   &lt;   &lt;=</pre><h3>⚡ Logical Operators</h3><p>Used to combine multiple conditions.</p><pre>&amp;&amp;   ||   !</pre><h3>🔢 Assignment Operators</h3><p>Used to assign values to variables.</p><pre>=   +=   -=   *=   /=   %=</pre><h3>📊 Bitwise (Advanced)</h3><p>Perform operations at the binary level.</p><pre>&amp;   |   ^   ~   &lt;&lt;   &gt;&gt;   &gt;&gt;&gt;</pre><blockquote><em>🔗 </em><strong><em>Best Practice:</em></strong><em> Always use </em><em>=== to avoid type coercion surprises.</em></blockquote><h3>🔹 7. Template Literals (String Interpolation)</h3><pre>let name = &quot;Tanmay&quot;;<br>console.log(`Hello, ${name}!`);</pre><p>👉 Use backticks (`) + ${} for cleaner formatting<br> 👉 Supports multi-line strings</p><h3>🛠️ Mini Projects to Practice These Concepts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*2NwcKrnt9_qQNwT3zGYX4w.png" /></figure><h3>🧠 What I’ve Learned (In My Own Words)</h3><blockquote><em>“VAR is a function-level or global-scope variable. It’s considered old and unsafe because it can be re-declared and leaks outside blocks.<br> LET and CONST are block-scoped — safer and cleaner.<br> JavaScript is dynamically typed — no need to define int or string.<br> It’s interpreted, not compiled.</em></blockquote><h3>📌 Summary &amp; What’s Next?</h3><p>✅ <strong>Covered:</strong></p><ul><li>Variable types</li><li>Hoisting &amp; TDZ</li><li>Data types with use cases</li><li>Operators</li><li>typeof, template literals</li><li>Functions</li></ul><p>🚀 <strong>Next Focus:</strong></p><ul><li>Loops</li><li>User input</li><li>Arrays and Array methods</li><li>Mini projects with real interaction</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caffe25df0bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 7 Blog — SQL :Mapping Simplified: One-to-One, One-to-Many, Many-to-Many, Joins, Constraints…]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/day-7-blog-sql-mapping-simplified-one-to-one-one-to-many-many-to-many-joins-constraints-551220161834?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/551220161834</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[rdbms]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 05:32:17 GMT</pubDate>
            <atom:updated>2025-07-21T05:57:42.095Z</atom:updated>
            <content:encoded><![CDATA[<h3>📘Day 7 Blog — SQL :Mapping Simplified: One-to-One, One-to-Many, Many-to-Many, Constraints &amp; Cascading</h3><h3>🔰 Introduction</h3><p>In any real-world database, tables don’t live alone. They often <strong>connect with each other</strong> through different types of relationships. This connection is called <strong>“Mapping”</strong>.</p><p>In this blog, I’ll walk you through:</p><ul><li>What SQL Mapping is</li><li>Different types of mappings (1:1, 1:N, M:N)</li><li>The role of constraints like PRIMARY KEY, FOREIGN KEY, UNIQUE</li><li>Join vs Mapping</li><li>Composite primary keys</li><li>Cascading effects</li><li>And best practices</li></ul><h3>🧩 What is SQL Mapping?</h3><p><strong>Mapping</strong> means creating a logical <strong>relationship between two or more tables</strong> using keys. This helps organize data properly and <strong>maintain consistency and validation</strong>.</p><h3>🔗 Types of Mapping in SQL</h3><h3>1️⃣ One-to-One (1:1)</h3><ul><li>One record in Table A maps to one record in Table B.</li><li>Example: One customer has one profile.</li></ul><pre>CREATE TABLE customers (<br>    customer_id INT PRIMARY KEY<br>);</pre><pre>CREATE TABLE profiles (<br>    profile_id INT PRIMARY KEY,<br>    customer_id INT UNIQUE, -- 🔥 UNIQUE is important<br>    FOREIGN KEY (customer_id) REFERENCES customers(customer_id)<br>);</pre><blockquote><em>🔍 Use </em><em>UNIQUE on the foreign key to ensure the mapping remains 1-to-1.</em></blockquote><h3>2️⃣ One-to-Many (1:N)</h3><ul><li>One record in Table A maps to <strong>multiple</strong> records in Table B.</li><li>Example: One customer can place many orders.</li></ul><pre>CREATE TABLE customers (<br>    customer_id INT PRIMARY KEY<br>);</pre><pre>CREATE TABLE orders (<br>    order_id INT PRIMARY KEY,<br>    customer_id INT,<br>    FOREIGN KEY (customer_id) REFERENCES customers(customer_id)<br>);</pre><blockquote><em>✅ In the </em><em>orders table, only </em><em>customer_id is stored — not full customer data.</em></blockquote><h3>3️⃣ Many-to-Many (M:N)</h3><ul><li>Many records in Table A relate to many in Table B.</li><li>Requires a <strong>junction table</strong> (a third table to manage relationships).</li></ul><pre>CREATE TABLE students (<br>    student_id INT PRIMARY KEY<br>);</pre><pre>CREATE TABLE courses (<br>    course_id INT PRIMARY KEY<br>);</pre><pre>CREATE TABLE student_courses (<br>    student_id INT,<br>    course_id INT,<br>    PRIMARY KEY (student_id, course_id),<br>    FOREIGN KEY (student_id) REFERENCES students(student_id),<br>    FOREIGN KEY (course_id) REFERENCES courses(course_id)<br>);</pre><blockquote><em>💡 This is called a </em><strong><em>composite primary key</em></strong><em> because two columns together act as the key.</em></blockquote><h3>🔀 Mapping vs Join — What’s the Difference?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hu7iy_AhOnzXhkiZ7cB0Fg.png" /></figure><h3>🔧 Join Example</h3><pre>SELECT c.name, o.order_id<br>FROM customers c<br>JOIN orders o ON c.customer_id = o.customer_id;</pre><blockquote><em>🎯 Use JOIN when you want actual combined data from both tables.</em></blockquote><h3>🛡️ Understanding SQL Constraints</h3><p><strong>Constraints</strong> are rules applied to columns/tables to ensure <strong>data integrity</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IOSAXDKaByDTXsP92qsazA.png" /></figure><h3>🧱 Column-Level vs Table-Level Constraints</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zceOcWUSqf6fAlHEJVMNrQ.png" /></figure><h4>🔧 Column-Level Example:</h4><pre>email VARCHAR(100) UNIQUE</pre><h4>🔧 Table-Level Example:</h4><pre>CONSTRAINT unique_email UNIQUE (email)</pre><h3>🧱 Composite Primary Key</h3><p>Used when <strong>no single column</strong> can uniquely identify a row, but a combination of columns can.</p><pre>CREATE TABLE student_courses (<br>    student_id INT,<br>    course_id INT,<br>    enrollment_date DATE,<br>    PRIMARY KEY (student_id, course_id)<br>);</pre><blockquote><em>🎯 This ensures no duplicate (student_id, course_id) pair exists.</em></blockquote><h3>🔄 Cascading Effect (ON DELETE / ON UPDATE)</h3><p>Cascading is used to <strong>automatically handle changes</strong> in parent-child relationships.</p><h3>✅ ON DELETE CASCADE</h3><pre>CREATE TABLE orders (<br>    order_id INT PRIMARY KEY,<br>    customer_id INT,<br>    FOREIGN KEY (customer_id) REFERENCES customers(customer_id)<br>    ON DELETE CASCADE<br>);</pre><blockquote><em>If a customer is deleted, all their orders are automatically deleted.</em></blockquote><h3>✅ ON UPDATE CASCADE</h3><pre>FOREIGN KEY (customer_id) REFERENCES customers(customer_id)<br>ON UPDATE CASCADE</pre><blockquote><em>If a customer_id is updated in the parent table, it updates here too.</em></blockquote><h3>💡 Best Practices for Cascading</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PN0nTDRZgIXIuNCDWisPaQ.png" /></figure><h3>🗣 Spoken-Style Interview Answers</h3><blockquote><strong><em>Q:</em></strong><em> What’s the difference between mapping and join?<br> </em><strong><em>A:</em></strong><em> Mapping defines structure-level relationships, join is used in queries to fetch data from multiple tables.</em></blockquote><blockquote><strong><em>Q:</em></strong><em> What is a composite primary key?<br> </em><strong><em>A:</em></strong><em> A primary key that uses multiple columns together to uniquely identify a row.</em></blockquote><blockquote><strong><em>Q:</em></strong><em> Why do we use ON DELETE CASCADE?<br> </em><strong><em>A:</em></strong><em> To automatically delete child rows when the parent row is deleted — useful when child data is fully dependent on parent.</em></blockquote><blockquote><strong><em>Q:</em></strong><em> What is the use of UNIQUE in One-to-One mapping?<br> </em><strong><em>A:</em></strong><em> It ensures that the foreign key value in the child table is also unique, so each parent maps to only one child.</em></blockquote><h3>✅ Final Summary</h3><ul><li>SQL Mapping defines how tables relate to each other.</li><li>Use PRIMARY, FOREIGN, UNIQUE constraints properly to enforce mapping rules.</li><li>Understand when to use JOIN vs just using foreign key mappings.</li><li>Composite keys help ensure multi-column uniqueness.</li><li>Cascading actions can make or break your database — use wisely!</li></ul><p>📘 <em>Thanks for reading! Hope this blog helps you truly understand SQL mapping.</em><br> 🧠 <em>Keep practicing. Real learning happens by doing!</em></p><p>✍️ <em>By Tanmay Wadibhasme</em><br> <em>Aspiring DevOps Engineer | Backend Learner | SQL Explorer</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=551220161834" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 6 Blog — SQL: Truncate, IN/NOT IN, BETWEEN, and Primary Key Auto-Increment]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/day-6-blog-sql-truncate-in-not-in-between-and-primary-key-auto-increment-d36e36b0528f?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d36e36b0528f</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[mysql-workbench]]></category>
            <category><![CDATA[sql-server]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Sat, 03 May 2025 19:36:51 GMT</pubDate>
            <atom:updated>2025-05-04T03:31:35.315Z</atom:updated>
            <content:encoded><![CDATA[<h3>📘 Day 6 Blog — SQL: Truncate, IN/NOT IN, BETWEEN, and Primary Key Auto-Increment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JdyRKI03DYnCdCR1APNrTw.png" /></figure><h3>📚 Today’s Learning Agenda</h3><p>In today’s blog, we’ll explore:</p><ul><li>Difference between TRUNCATE, DELETE, and DROP</li><li>Usage of IN, NOT IN, BETWEEN, and NOT BETWEEN</li><li>Creating a PRIMARY KEY with AUTO_INCREMENT</li><li>Small use cases and homework to revise.</li></ul><h3>🗑️ TRUNCATE vs DELETE vs DROP</h3><h3>🔹 1. DELETE FROM &lt;table&gt;</h3><ul><li>Deletes <strong>rows</strong> from the table.</li><li>Can be used with WHERE to filter.</li></ul><h3>🔹 2. TRUNCATE TABLE &lt;table&gt;</h3><ul><li>Deletes <strong>all rows</strong>, like delete, but:</li><li><strong>Faster</strong></li><li><strong>Cannot use WHERE</strong></li><li><strong>Resets auto-increment ID</strong></li></ul><pre>DELETE FROM students WHERE name = &#39;Tanmay&#39;;<br>TRUNCATE TABLE students;</pre><h3>🔹 3. DROP TABLE &lt;table&gt;</h3><ul><li>Removes the <strong>entire table structure</strong> and data.</li></ul><pre>DROP TABLE students;</pre><h3>🧠 Use of IN and NOT IN</h3><p>Used to <strong>match a value against a list of values</strong>.</p><h3>🔹 Syntax:</h3><pre>SELECT * FROM students WHERE name IN (&#39;Pooja&#39;, &#39;Neha&#39;, &#39;Sanket&#39;);<br>SELECT * FROM students WHERE name NOT IN (&#39;Pooja&#39;, &#39;Neha&#39;, &#39;Sanket&#39;);</pre><h3>✅ Output Example:</h3><p>Fetch records of students <strong>included</strong> or <strong>excluded</strong> from a list of names.</p><h3>🎯 Use of BETWEEN and NOT BETWEEN</h3><p>Used to filter values <strong>within a range</strong>.</p><h3>🔹 Syntax:</h3><pre>SELECT * FROM students WHERE height BETWEEN 5.3 AND 5.8;<br>SELECT * FROM students WHERE height NOT BETWEEN 5.3 AND 5.8;</pre><h3>✅ Output Example:</h3><p>Returns students whose height is:</p><ul><li>Between 5.3 and 5.8</li><li>OR not in that range, respectively</li></ul><h3>🔑 PRIMARY KEY with AUTO_INCREMENT</h3><p>Use AUTO_INCREMENT to generate unique IDs automatically.</p><h3>🔹 Syntax:</h3><pre>CREATE TABLE emp (<br>  id INT PRIMARY KEY AUTO_INCREMENT,<br>  name TEXT<br>);</pre><h3>✅ Output Example:</h3><p>Each time you insert a new employee, id increases by 1.</p><pre>INSERT INTO emp(name) VALUES (&#39;Tanmay&#39;);<br>-- id = 1<br>INSERT INTO emp(name) VALUES (&#39;Pratik&#39;);<br>-- id = 2</pre><h3>🏡 Homework</h3><ol><li>What’s the key difference between TRUNCATE and DELETE?</li><li>Can you use TRUNCATE with a WHERE clause?</li><li>Create a table products with auto-incrementing product_id and name.</li><li>Use NOT IN to exclude names from a dataset</li><li>Use BETWEEN to filter prices between 100 and 500.</li></ol><h3>🧠 Daily MCQs</h3><ol><li><strong>Which of the following can’t be used with WHERE?</strong><br> a) DELETE<br> b) TRUNCATE ✅<br> c) SELECT</li><li><strong>Which query resets identity/autoincrement?</strong><br> a) DELETE<br> b) DROP<br> c) TRUNCATE ✅</li><li><strong>Which statement filters rows in a specific range?</strong><br> a) BETWEEN ✅<br> b) LIKE<br> c) LIMIT</li></ol><h3>🧭 Mind Map</h3><pre>Day 6 SQL<br>├── TRUNCATE vs DELETE vs DROP<br>│   ├── DELETE → with WHERE<br>│   ├── TRUNCATE → no WHERE, resets ID<br>│   └── DROP → deletes table<br>├── IN / NOT IN<br>│   └── Filters from list<br>├── BETWEEN / NOT BETWEEN<br>│   └── Filters by range<br>└── AUTO_INCREMENT<br>    └── Auto ID with PRIMARY KEY</pre><h3>📄 PDF Tasks</h3><p>➡️ Day 6 practice PDF here:<br> <a href="https://drive.google.com/file/d/1CT3ZodeHOMpRoIXiy1Hkm00O2Kt_Z5tl/view?usp=sharing">Day_6_SQL_Tasks.pdf</a></p><h3>📌 Next Up (Day 7 Agenda)</h3><ul><li>Relationships Between Tables</li><li>Foreign Key</li><li>One-to-One, One-to-Many, Many-to-Many</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d36e36b0528f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 5 Blog — SQL Learning Journey]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/day-5-blog-sql-learning-journey-e07b7bad5ec0?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e07b7bad5ec0</guid>
            <category><![CDATA[mysql-workbench]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[sql-server]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Mon, 28 Apr 2025 14:12:37 GMT</pubDate>
            <atom:updated>2025-04-28T14:12:37.971Z</atom:updated>
            <content:encoded><![CDATA[<h3>📘 Day 5 Blog — SQL Learning Journey</h3><h3>📚 Today’s Learning Agenda</h3><p>In this blog, we will learn:</p><ul><li>How to <strong>modify</strong> a column in an existing table using ALTER.</li><li>How to <strong>rename</strong> a column and a table.</li><li>How to <strong>sort</strong> data using ORDER BY.</li><li>How to use <strong>Wildcard Characters</strong> (% and _) to perform flexible searches.</li><li>Some <strong>SQL Homework</strong> for practice!</li></ul><h3>✏️ Alter Command: Modifying Existing Table</h3><h3>🔹 Syntax to Modify a Column</h3><pre>ALTER TABLE &lt;table_name&gt; MODIFY &lt;column_name&gt; &lt;data_type&gt;;</pre><h3>🔹 Example</h3><pre>ALTER TABLE friends MODIFY age TEXT;</pre><h3>✏️ Alter Command: Renaming a Column</h3><h3>🔹 Syntax</h3><pre>ALTER TABLE &lt;table_name&gt; RENAME COLUMN &lt;old_column_name&gt; TO &lt;new_column_name&gt;;</pre><h3>🔹 Example</h3><pre>ALTER TABLE friends RENAME COLUMN address TO location;</pre><h3>✏️ Alter Command: Renaming the Entire Table</h3><h3>🔹 Syntax</h3><pre>ALTER TABLE &lt;table_name&gt; RENAME TO &lt;new_table_name&gt;;</pre><h3>🔹 Example</h3><pre>ALTER TABLE friends RENAME TO buddies;</pre><h3>📋 ORDER BY Clause</h3><ul><li>Sorts the records <strong>based on a specific column</strong>.</li><li><strong>Ascending order</strong> is default.</li><li>For <strong>descending order</strong>, use the keyword DESC.</li><li>You can <strong>limit</strong> the number of displayed records using the LIMIT keyword.</li><li>If multiple columns are mentioned, <strong>only the first one</strong> is considered; others are <strong>ignored</strong>.</li></ul><h3>🔹 Example</h3><pre>SELECT * FROM students ORDER BY height DESC LIMIT 5;</pre><h3>🎯 Wildcard Characters in SQL</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H5skPUTTRYYNFEz63lhY4Q.png" /></figure><h3>✨ Wildcard Code Samples with Output</h3><h3>🔹 Using % Wildcard</h3><pre>SELECT * FROM students WHERE name LIKE &#39;A%&#39;;</pre><p><strong>Explanation:</strong></p><ul><li>This query fetches all students whose names <strong>start with ‘A’</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S0AzSH5lcLb2D4sJyUDOVA.png" /></figure><h3>🔹 Using _ Wildcard</h3><pre>SELECT * FROM students WHERE name LIKE &#39;_lex&#39;;</pre><p><strong>Explanation:</strong></p><ul><li>This query fetches all students whose names have <strong>any single character followed by ‘lex’</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSUjAGPWN_soAk3vcQqIpA.png" /></figure><h3>🏡 Homework</h3><ol><li>How to <strong>assign a name</strong> to a CHECK constraint?</li><li>How to <strong>remove</strong> a CHECK constraint from a column?</li><li>Can we have <strong>multiple </strong><strong>CHECK constraints</strong> on a single table?</li></ol><p>reccommended Exercise:-</p><h3>🚀 What’s Next</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e07b7bad5ec0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL for Beginners: Day 4 — Default, Check, Unique Constraints & Alter Command]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/sql-for-beginners-day-4-default-check-unique-constraints-alter-command-cb747ddef611?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb747ddef611</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[mysql-server]]></category>
            <category><![CDATA[beginner]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Mon, 28 Apr 2025 12:32:34 GMT</pubDate>
            <atom:updated>2025-07-21T05:54:16.207Z</atom:updated>
            <content:encoded><![CDATA[<h3>📘 SQL for Beginners: Day 4 — Default, Check, Unique Constraints &amp; Alter Command</h3><p>Welcome to <strong>Day 4</strong> of our SQL Learning Journey! 🚀<br> Today, we learn about <strong>default values, validations</strong>, and <strong>how to modify tables dynamically</strong> using SQL commands!</p><h3><strong>What is Constraint</strong></h3><p>Constraints in SQL are <strong>rules and restrictions</strong> applied on <strong>columns or tables</strong> to ensure <strong>data safety, validation, and consistency</strong>.<br> Common types of constraints include:</p><ul><li>PRIMARY KEY</li><li>FOREIGN KEY</li><li>UNIQUE</li><li>NOT NULL</li><li>CHECK</li><li>DEFAULT</li></ul><p><strong>At the column level</strong>, we directly mention the constraint next to the column definition — for example:<br> email VARCHAR(100) UNIQUE</p><p><strong>At the table level</strong>, we define constraints <strong>separately after all column definitions</strong>, especially for more complex rules — for example:<br> CONSTRAINT unique_email UNIQUE(email)</p><p>Column-level constraints are best for simple checks like NOT NULL, DEFAULT, or single-column UNIQUE.<br> But table-level constraints are used when we have <strong>multiple columns involved</strong> — like <strong>composite </strong><strong>UNIQUE</strong>, <strong>composite </strong><strong>PRIMARY KEY</strong>, or <strong>FOREIGN KEY</strong> definitions</p><h3>🛡️ 1. Default Constraint in SQL</h3><p>The <strong>Default Constraint</strong> is used to automatically assign a default value to a column when no value is provided during insertion.</p><h3>📚 Key Points:</h3><ul><li>Provides a <strong>default value</strong> if user doesn’t specify one.</li><li>Works only with <strong>certain data types</strong>.</li><li>Can be <strong>combined with NOT NULL</strong> constraints.</li></ul><h3>🧱 Example:</h3><pre>CREATE TABLE books(<br>  name VARCHAR(15) NOT NULL DEFAULT &#39;ABC&#39;,<br>  author TEXT<br>);</pre><p>✨ Here, if a name isn’t provided, it automatically gets ‘ABC’!</p><h3>🕵️‍♂️ 2. Check Constraint in SQL</h3><p>The <strong>Check Constraint</strong> is used to limit the values that can be placed in a column.</p><h3>📚 Key Points:</h3><ul><li>Ensures data <strong>meets a specific condition</strong>.</li><li>Applied during <strong>table creation</strong>.</li></ul><h3>🧱 Example:</h3><pre>CREATE TABLE voters (<br>  name TEXT,<br>  age INT,<br>  CHECK (age &gt;= 21)<br>);</pre><p>✅ Only people aged 21 or above can be inserted into voters table!</p><h3>🏅 3. Unique Constraint in SQL</h3><p>The <strong>Unique Constraint</strong> ensures that <strong>all values in a column are different</strong>.</p><h3>📚 Key Points:</h3><ul><li>Maintains <strong>uniqueness</strong> of data in a column.</li></ul><h3>🧱 Example:</h3><pre>CREATE TABLE students(<br>  roll INT UNIQUE,<br>  name TEXT,<br>  height FLOAT,<br>  isPresent BOOLEAN<br>);</pre><p>🚫 No two students can have the same roll number!</p><h3>🛠️ 4. ALTER Command in SQL</h3><p>The <strong>ALTER command</strong> belongs to DDL (Data Definition Language) and is used to <strong>modify table structures</strong>.</p><h3>📚 Key Points:</h3><p>Using ALTER, we can:</p><ul><li>➕ Add a new column</li><li>➖ Remove an existing column</li><li>✏️ Modify a column</li><li>🔀 Rename a column</li><li>📋 Rename the table</li></ul><h3>➕ A. Add Column</h3><h4>Syntax:</h4><pre>ALTER TABLE &lt;table_name&gt; ADD &lt;column_name&gt; &lt;data_type&gt;;<br>-- OR<br>ALTER TABLE &lt;table_name&gt; ADD COLUMN &lt;column_name&gt; &lt;data_type&gt;;</pre><h4>Example:</h4><pre>ALTER TABLE voters ADD aadhar INT;<br>-- OR<br>ALTER TABLE voters ADD COLUMN aadhar INT;</pre><h3>➖ B. Remove Column</h3><h4>Syntax:</h4><pre>ALTER TABLE &lt;table_name&gt; DROP &lt;column_name&gt;;<br>-- OR<br>ALTER TABLE &lt;table_name&gt; DROP COLUMN &lt;column_name&gt;;</pre><h4>Example:</h4><pre>ALTER TABLE voters DROP aadhar;<br>-- OR<br>ALTER TABLE voters DROP COLUMN aadhar;</pre><h3>🧠 Quick Practice Challenges:</h3><ol><li>Create a table products with id, name, and price where price should <strong>always be greater than 0</strong>.</li><li>Add a new column discount to the products table.</li><li>Make sure that id is <strong>unique</strong>.</li></ol><h3>✨ Sneak Peek for Tomorrow</h3><ul><li>🔧 Modify an existing column</li><li>🔄 Rename a column</li><li>🏷️ Rename the entire table</li><li>📈 Order data with ORDER BY</li><li>🎯 Group data with GROUP BY</li></ul><h3>📝 SQL Daily MCQs</h3><ol><li><strong>Which constraint ensures no two rows have the same value in a column?</strong></li></ol><ul><li>a) CHECK</li><li>b) DEFAULT</li><li>c) UNIQUE ✅</li></ul><p><strong>2. What does the ALTER command do?</strong></p><ul><li>a) Insert new data</li><li>b) Modify table structure ✅</li><li>c) Select data</li></ul><p><strong>3. Which constraint sets a fallback value for a column?</strong></p><ul><li>a) UNIQUE</li><li>b) CHECK</li><li>c) DEFAULT ✅</li></ul><h3>🗺️ Recap Diagram</h3><pre>SQL Constraints<br>├── DEFAULT → Auto-fill values<br>├── CHECK → Data validation<br>├── UNIQUE → No duplicate values<br>ALTER TABLE<br>├── ADD COLUMN<br>├── DROP COLUMN<br>├── MODIFY COLUMN (Coming Soon)<br>├── RENAME COLUMN (Coming Soon)<br>└── RENAME TABLE (Coming Soon)</pre><h3>🌐 My GitHub Learning Repository</h3><p>Track all my blogs, commands, and notes:<br> 🔗 GitHub Repo Link</p><h3>🏁 Conclusion</h3><p>Day 4 added <strong>professional data validation</strong> and <strong>table modification</strong> skills to your SQL toolkit! 🚀<br> Tomorrow we will make your data even <strong>smarter and more organized</strong> with <strong>ORDER BY</strong> and <strong>GROUP BY</strong> commands!</p><p><em>“Building clean databases is like building clean cities — small details matter!”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb747ddef611" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL for Beginners: Day 3 — Delete, Update, Aggregate Functions & NOT NULL Constraint]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/sql-for-beginners-day-3-delete-update-aggregate-functions-not-null-constraint-d9b12794586d?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9b12794586d</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mysql-workbench]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Fri, 25 Apr 2025 06:45:48 GMT</pubDate>
            <atom:updated>2025-07-19T18:55:54.973Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL for Beginners: Day 3 — Delete, Update, Aggregate Functions &amp; NOT NULL Constraint</h3><p>Welcome to <strong>Day 3</strong> of your SQL journey! 🚀 Today’s focus is on data modification and summary: <strong>DELETE, </strong><strong>UPDATE</strong>, <strong>Aggregate Functions</strong>, and understanding the <strong>NOT NULL Constraint</strong>.</p><p>Let’s dive in with hands-on examples, real-world queries, and smart tips!</p><h3>🔥 DELETE Command</h3><p>Used to remove data from tables.</p><h3>🧾 Syntax:</h3><pre>delete from &lt;table_name&gt;;            -- Deletes ALL records<br>delete from &lt;table_name&gt; where &lt;condition&gt;; -- Deletes selective records</pre><h3>✅ Example:</h3><pre>delete from students; -- Deletes ALL records from students table<br>delete from students where isPresent = 0; -- Deletes students who were absent</pre><blockquote><em>⚠️ </em><strong><em>Tip:</em></strong><em> Always double-check your </em><em>WHERE clause to avoid deleting all data unintentionally!</em></blockquote><h3>🔄 UPDATE Command</h3><p>Used to modify data in one or more columns.</p><h3>🧾 Syntax:</h3><pre>update &lt;table_name&gt; set &lt;column_name&gt; = &lt;value&gt;;<br>update &lt;table_name&gt; set &lt;column_name&gt; = &lt;value&gt; where &lt;condition&gt;;</pre><h3>✅ Example:</h3><pre>update students set height = 6.0; -- Updates ALL records<br>update students set height = 6.0 where isPresent = 1; -- Updates students who are present</pre><blockquote><em>📝 </em><strong><em>Note:</em></strong><em> Use </em><em>WHERE to avoid overwriting all rows.</em></blockquote><h3>📊 Aggregate Functions in SQL</h3><p>These functions return a single value by performing calculations on a column.</p><h3>🎯 List of Aggregates:</h3><ul><li>MAX() – Returns the highest value</li><li>MIN() – Returns the lowest value</li><li>AVG() – Returns the average value</li><li>SUM() – Returns the total sum</li><li>COUNT() – Returns the count of records</li></ul><h3>✅ Examples:</h3><pre>SELECT AVG(height) FROM students;<br>SELECT AVG(height) AS &#39;Average&#39; FROM students;</pre><pre>SELECT MAX(height) FROM students;<br>SELECT MAX(height) AS &#39;Tallest&#39; FROM students;</pre><pre>SELECT MIN(height) FROM students;<br>SELECT MIN(height) AS &#39;Shortest&#39; FROM students;</pre><pre>SELECT SUM(height) FROM students;<br>SELECT SUM(height) AS &#39;Addition&#39; FROM students;</pre><pre>SELECT COUNT(name) FROM students;<br>SELECT COUNT(name) AS &#39;Attendance&#39; FROM students;</pre><blockquote><em>🔍 </em><strong><em>Practice Tip:</em></strong><em> Try using aggregate functions on custom datasets like </em><em>orders, </em><em>products, or </em><em>employees.</em></blockquote><h3>What is Constraint</h3><blockquote>Constraints in SQL are <strong>rules and restrictions</strong> applied on <strong>columns or tables</strong> to ensure <strong>data safety, validation, and consistency</strong>.<br> Common types of constraints include:</blockquote><blockquote>PRIMARY KEY</blockquote><blockquote>FOREIGN KEY</blockquote><blockquote>UNIQUE</blockquote><blockquote>NOT NULL</blockquote><blockquote>CHECK</blockquote><blockquote>DEFAULT</blockquote><blockquote><strong>At the column level</strong>, we directly mention the constraint next to the column definition — for example:<br> email VARCHAR(100) UNIQUE</blockquote><blockquote><strong>At the table level</strong>, we define constraints <strong>separately after all column definitions</strong>, especially for more complex rules — for example:<br> CONSTRAINT unique_email UNIQUE(email)</blockquote><blockquote>Column-level constraints are best for simple checks like NOT NULL, DEFAULT, or single-column UNIQUE.<br> But table-level constraints are used when we have <strong>multiple columns involved</strong> — like <strong>composite </strong><strong>UNIQUE</strong>, <strong>composite </strong><strong>PRIMARY KEY</strong>, or <strong>FOREIGN KEY</strong> definitions</blockquote><h3>🚫 NOT NULL Constraint</h3><p>Prevents a column from having NULL values.</p><h3>📌 Syntax &amp; Example:</h3><pre>CREATE TABLE books (<br>  name TEXT NOT NULL,<br>  author TEXT<br>);</pre><pre>INSERT INTO books VALUES(&#39;Java&#39;, &#39;James&#39;); -- ✅ OK<br>INSERT INTO books(name) VALUES(&#39;C++&#39;);     -- ✅ OK<br>INSERT INTO books(author) VALUES(&#39;Peter&#39;); -- ❌ Fails (name can&#39;t be NULL)</pre><blockquote><em>📢 </em><strong><em>Remember:</em></strong><em> </em><em>NOT NULL ensures data presence in a column.</em></blockquote><h3>🧠 Interview Questions</h3><ol><li><strong>What is the use of DELETE in SQL?</strong><br> To remove data from a table, either all or conditionally.</li><li><strong>What’s the difference between DELETE and DROP?</strong><br> DELETE removes rows; DROP removes the table structure itself.</li><li><strong>When should you use UPDATE instead of INSERT?</strong><br> Use UPDATE to change existing data; INSERT adds new rows.</li><li><strong>List all aggregate functions in SQL.</strong><br> MAX, MIN, AVG, SUM, COUNT</li><li><strong>What does NOT NULL mean?</strong><br> It ensures a column must contain a value.</li></ol><h3>🧪 Try-It-Yourself Practice</h3><blockquote><em>💻 </em><strong><em>Challenge 1:</em></strong><em> Create a table </em><em>employees with </em><em>name, </em><em>salary, </em><em>experience.</em></blockquote><blockquote><em>Then update all salaries of employees with </em><em>experience &gt; 5 to </em><em>60000.</em></blockquote><blockquote><em>💻 </em><strong><em>Challenge 2:</em></strong><em> Create a table </em><em>marks with </em><em>student, </em><em>subject, </em><em>score.</em></blockquote><blockquote><em>Insert 5 records and calculate the average score.</em></blockquote><h3>📝 MCQs of the Day</h3><ol><li>What is the output of COUNT(name) if there are 4 records?</li></ol><ul><li>a) 0</li><li>b) 4 ✅</li><li>c) name</li></ul><ol><li>What happens if you run DELETE FROM students; without WHERE?</li></ol><ul><li>a) Some rows deleted</li><li>b) All rows deleted ✅</li><li>c) Error</li></ul><ol><li>Which one is <strong>not</strong> an aggregate function?</li></ol><ul><li>a) COUNT</li><li>b) MIN</li><li>c) INSERT ✅</li></ul><h3>🔁 Recap</h3><pre>SQL Day 3 Topics:<br>├── DELETE<br>│   └── Remove rows<br>├── UPDATE<br>│   └── Modify values<br>├── Aggregate Functions<br>│   ├── MAX<br>│   ├── MIN<br>│   ├── AVG<br>│   ├── SUM<br>│   └── COUNT<br>|<br>└── NOT NULL Constraint<br>    └── Prevent NULL entries</pre><h3>🏁 Wrapping Up</h3><p>Day 3 taught you how to <strong>clean</strong>, <strong>modify</strong>, and <strong>summarize</strong> data. You’re building a strong foundation! Day 4 will focus on <strong>constraints like CHECK, DEFAULT, and KEYS</strong>.</p><p>Keep querying, keep learning 💡</p><blockquote>“Without SQL, data is just a mess waiting to be discovered.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9b12794586d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL for Beginners: Day 2 — Types of Queries, Table Commands & Data Filtering]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/sql-for-beginners-day-2-types-of-queries-table-commands-data-filtering-d6f164471ee6?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6f164471ee6</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[dbms]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Tue, 22 Apr 2025 15:06:02 GMT</pubDate>
            <atom:updated>2025-04-22T15:06:02.554Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL for Beginners: Day 2 — Types of Queries, Table Commands &amp; Data Filtering</h3><p>Welcome to Day 2 of your SQL Learning Journey! 🚀 Today, we explore the <strong>types of SQL queries</strong>, understand <strong>DDL operations</strong>, and start performing meaningful queries using SELECT with filters. Let’s dive into real examples, interview prep, and hands-on commands!</p><h3>🧠 Types of SQL Queries</h3><p>SQL commands are divided into <strong>5 main categories</strong>, each serving a unique purpose:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w9BCYe1iufVfFt66M74RYw.png" /></figure><h3>🧱 DDL: Data Definition Language</h3><p>These commands define the structure of databases and tables.</p><h3>📌 Common DDL Commands</h3><pre>CREATE DATABASE batch215;<br>SHOW DATABASES;<br>USE batch215;</pre><pre>CREATE TABLE students (<br>  roll INT,<br>  name TEXT,<br>  height FLOAT,<br>  isPresent BOOLEAN<br>);</pre><h3>➕ ALTER TABLE</h3><p>Used to modify the structure of an existing table.</p><pre>ALTER TABLE students ADD COLUMN age INT;<br>ALTER TABLE students DROP COLUMN age;<br>ALTER TABLE students RENAME TO student_info;</pre><h3>❌ DROP</h3><p>Used to delete databases or tables permanently.</p><pre>DROP TABLE students;<br>DROP DATABASE batch215;</pre><h3>🧐 Viewing Structure</h3><pre>SHOW TABLES;<br>SHOW COLUMNS FROM students;<br>DESCRIBE students;</pre><h3>🧾 DML: Insert Data</h3><p>Add sample data into our students table:</p><pre>INSERT INTO students VALUES (101, &#39;Pawan&#39;, 5.4, TRUE);<br>INSERT INTO students VALUES (102, &#39;Prashant&#39;, 5.3, TRUE);<br>INSERT INTO students VALUES (103, &#39;Sanket&#39;, 5.8, FALSE);<br>INSERT INTO students VALUES (104, &#39;Tanmay&#39;, 5.2, TRUE);<br>INSERT INTO students VALUES (105, &#39;Prajakta&#39;, 5.9, FALSE);</pre><h3>🔍 DQL: Select Data</h3><pre>SELECT * FROM students;<br>SELECT name FROM students;<br>SELECT name, height FROM students;</pre><h3>🎯 Filtered Data</h3><p>Students with height &gt; 5.5 AND present today:</p><pre>SELECT name FROM students WHERE height &gt; 5.5 AND isPresent = 1;</pre><h3>🧠 MySQL Data Types (Quick Summary)</h3><blockquote><em>Full reference in Excel: [</em><a href="https://docs.google.com/spreadsheets/d/1wvwNwz6EayfI0zUOEyHiKAwlBY4srO1AlqYTro-G7PA/edit?usp=sharing"><em>MySQL_Data_Types.xlsx</em></a><em>]</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ntGMRHqFAXcYexFZivGBA.png" /></figure><h3>✨ Additional Tips</h3><ul><li>BOOLEAN is stored as TINYINT(1) in MySQL</li><li>Use AS to alias column names: SELECT name AS Student_Name FROM students;</li></ul><h3>🧠 Interview Questions with Answers</h3><ol><li><strong>What are the types of SQL queries?</strong><br> There are five types: DDL, DML, DQL, DCL, and TCL.</li><li><strong>What does DDL stand for?</strong><br> Data Definition Language</li><li><strong>How do you create a table in MySQL?</strong></li></ol><pre>CREATE TABLE students (...);</pre><ol><li><strong>What is the purpose of ALTER TABLE?</strong><br> To add, delete, or modify columns in an existing table.</li><li><strong>What command shows the structure of a table?</strong></li></ol><pre>DESCRIBE students;</pre><ol><li><strong>What does the SELECT command do?</strong><br> It retrieves data from a table.</li><li><strong>How to filter records based on multiple conditions?</strong></li></ol><pre>SELECT ... WHERE condition1 AND condition2;</pre><ol><li><strong>How is BOOLEAN stored in MySQL?</strong><br> As TINYINT(1)</li></ol><h3>📝 Daily SQL MCQs</h3><ol><li>ALTER TABLE is used for: <br> a) Changing database name<br> b) Dropping databases<br> c) Modifying table structure ✅</li><li>What is the full form of DDL?<br> a) Data Dynamic Logic<br> b) Data Definition Language ✅<br> c) Data Description Layer</li><li>Which command retrieves data? <br> a) INSERT<br> b) SELECT ✅<br> c) DELETE</li></ol><h3>🧠 Mind Map</h3><pre>SQL Queries<br>├── DDL<br>│   ├── CREATE<br>│   ├── ALTER<br>│   ├── DROP<br>├── DML<br>│   ├── INSERT<br>│   ├── UPDATE<br>│   └── DELETE<br>├── DQL<br>│   └── SELECT<br>├── DCL<br>│   ├── GRANT<br>│   └── REVOKE<br>└── TCL<br>    ├── COMMIT<br>    └── ROLLBACK</pre><h3>🌐 My GitHub Learning Repository</h3><p>Track my daily SQL learning with commands, practice, and notes: 🔗 GitHub Repo Link</p><h3>🏁 Conclusion</h3><p>That wraps up Day 2 of your SQL journey! Now you know how to <strong>create and manage tables</strong>, <strong>insert and query data</strong>, and apply <strong>filtering</strong> using conditions. In Day 3, we’ll explore <strong>constraints, keys, and more practical scenarios</strong>. Stay tuned and keep practicing 💪</p><blockquote>“SQL isn’t just code — it’s how we talk to data.”</blockquote><p>📢 If you liked this, drop a star on the repo, share with friends, and follow for more content!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6f164471ee6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL for Beginners: Day 1 — Learn the Basics with Examples, Questions, and Practice]]></title>
            <link>https://medium.com/@wadibhasmetanmay605/sql-for-beginners-day-1-learn-the-basics-with-examples-questions-and-practice-def45d956bc0?source=rss-acad9cc0e2b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/def45d956bc0</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[rdbms]]></category>
            <category><![CDATA[dbms]]></category>
            <dc:creator><![CDATA[Tanmay wadibhasme]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 10:56:54 GMT</pubDate>
            <atom:updated>2025-08-16T10:17:24.057Z</atom:updated>
            <content:encoded><![CDATA[<h3>SQL for Beginners: Day 1 — Learn the Basics with Examples, Questions, and Practice</h3><p>Welcome to Day 1 of your SQL Learning Journey! 🚀 In this post, we’ll cover everything from understanding SQL to performing your first real database operations. Let’s make it beginner-friendly, practical, and interview-ready!</p><h3>🔰 What is SQL?</h3><p>SQL stands for <strong>Structured Query Language</strong>. It is the standard language used to <strong>communicate with relational databases</strong>. Using SQL, we can:</p><ul><li><strong>Insert</strong> data</li><li><strong>Retrieve </strong>data</li><li><strong>Update </strong>data</li><li><strong>Delete </strong>data</li></ul><h3>🔹 SQL is Declarative language</h3><p>This means we tell the database <em>what</em> we want, not <em>how</em> to do it.</p><p><strong>Example:</strong></p><pre>SELECT name FROM students;</pre><p>We simply request data, and the SQL engine handles the process internally.</p><p><em>Think of it like ordering food in a restaurant: you tell the waiter what you want, not how to cook it.</em> 🍽️</p><h3>💻 What is MySQL?</h3><p>MySQL is an <strong>open-source relational database management system (RDBMS)</strong> that uses SQL to manage data. It’s one of the most popular database systems used in web development.</p><h3>🔸 SQL vs MySQL:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5csu60X88RGeio94nwGmDA.png" /><figcaption>originally developed by MySQL AB, is now owned by Oracle Corporation after its acquisition in 2010.</figcaption></figure><h3>📦 DBMS vs RDBMS</h3><p><strong>DBMS</strong> = Database Management System<br> <strong>RDBMS</strong> = Relational Database Management System</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcIfLOK6Ce5Ft3eNtdr0Pw.png" /></figure><h3>🧩 What is a Relation?</h3><p>In RDBMS, a <strong>Relation</strong> is simply a <strong>table</strong> that stores data in <strong>rows and columns</strong>.</p><h3>❓ What is a Query?</h3><p>A <strong>query</strong> is a command/statement written in SQL to interact with the database.</p><p>Types of queries:</p><ul><li>SELECT – Read data</li><li>INSERT – Add data</li><li>UPDATE – Change existing data</li><li>DELETE – Remove data</li></ul><h3>🔄 CRUD Operations in SQL</h3><p>CRUD stands for:</p><ul><li><strong>Create</strong> — Add data → INSERT</li><li><strong>Read</strong> — Fetch data → SELECT</li><li><strong>Update</strong> — Modify data → UPDATE</li><li><strong>Delete</strong> — Remove data → DELETE</li></ul><p>These are the 4 core operations in any database-driven app.</p><h3>✨ SQL Syntax Examples</h3><h3>Creating a Table</h3><p>The CREATE TABLE statement is used to create a new table in a database.</p><pre>CREATE TABLE students (<br>  id INT PRIMARY KEY,<br>  name VARCHAR(50),<br>  marks INT<br>);</pre><h3>Insert Example</h3><p>The INSERT INTO statement is used to insert new records in a table.</p><pre>INSERT INTO students (id, name, marks) VALUES (1, &#39;Tanmay&#39;, 90);</pre><h3>Select Example</h3><pre>SELECT * FROM students;</pre><h3>Update Example</h3><p>The UPDATE statement is used to modify the existing records in a table.</p><pre>UPDATE students SET marks = 95 WHERE id = 1;</pre><blockquote><strong>Note:</strong> Be careful when updating records in a table! Notice the WHERE clause in the UPDATE statement. The WHERE clause specifies which record(s) that should be updated. If you omit the WHERE clause, all records in the table will be updated!</blockquote><h3>Delete Example</h3><p>DELETE statement is used to delete existing records in a table.</p><pre>DELETE FROM students WHERE id = 1;<br></pre><blockquote><strong>Note:</strong> Be careful when deleting records in a table! Notice the WHERE clause in the DELETE statement. The WHERE clause specifies which record(s) should be deleted. If you omit the WHERE clause, all records in the table will be deleted!</blockquote><h3>🧠 Interview Questions</h3><ol><li><strong>What is SQL?</strong></li><li><strong>What is MySQL?</strong></li><li><strong>SQL vs MySQL?</strong></li><li><strong>What is DBMS?</strong></li><li><strong>What is RDBMS?</strong><br> <strong>RDBMS (Relational Database Management System)</strong> is a type of DBMS (Database Management System) that stores data in the form of <strong>tables (also called relations)</strong>. It supports <strong>relationships between tables.</strong></li><li><strong>What is a relation?</strong></li><li><strong>What is a query?</strong></li><li><strong>What are CRUD operations?</strong></li><li><strong>What happens if DELETE is used without WHERE?</strong><br>All records in the table will be deleted.</li><li><strong>Write an INSERT query.</strong></li></ol><pre>INSERT INTO students (id int, name text, marks int) VALUES (1, &#39;Tanmay&#39;, 90);</pre><h3>📝 Daily SQL MCQs</h3><ol><li>SQL is a ___ language.<br> a) Procedural<br> b) Declarative ✅<br> c) Object-oriented<br> d) Functional</li><li>What does CRUD stand for?<br> a) Create, Remove, Update, Drop<br> b) Copy, Read, Undo, Delete<br> c) Create, Read, Update, Delete ✅</li><li>What is the purpose of SELECT query?<br> a) Delete data<br> b) Add data<br> c) Fetch data ✅</li></ol><h3>📌 Mind Map</h3><pre>SQL<br>├── DBMS vs RDBMS<br>├── MySQL<br>├── CRUD<br>│   ├── INSERT<br>│   ├── SELECT<br>│   ├── UPDATE<br>│   └── DELETE<br>└── Practice + Interview Qs</pre><h3>🏁 Conclusion</h3><p>This is just Day 1, and you’ve already taken your first step into databases! Tomorrow, we’ll explore more on constraints, keys, and queries. Save this post, and stay consistent 💪</p><blockquote>“Learning SQL is like learning to speak to your data.”</blockquote><p>📢 If you found this helpful, share it with your friends and follow along! Drop a comment for questions or suggestions ✌️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=def45d956bc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>