<?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: VARUN</title>
    <description>The latest articles on DEV Community by VARUN (@varun_924260e48ba54f2360e).</description>
    <link>https://dev.to/varun_924260e48ba54f2360e</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%2F3837871%2F980b019d-05b5-4055-869d-982d948a0c0f.jpg</url>
      <title>DEV Community: VARUN</title>
      <link>https://dev.to/varun_924260e48ba54f2360e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/varun_924260e48ba54f2360e"/>
    <language>en</language>
    <item>
      <title>CA 32 - Filter Assignments</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 29 Mar 2026 17:32:51 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-32-filter-assignments-m6h</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-32-filter-assignments-m6h</guid>
      <description>&lt;p&gt;Get all movies (films) that have a rental rate greater than $3.&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%2Fz6nauzsukyjwxjnt0rhi.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%2Fz6nauzsukyjwxjnt0rhi.png" alt=" " width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title, rental_rate FROM film WHERE rental_rate &amp;gt; 3;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to fetch the title and rental_rate from film table and it must fetch the data which is having the rental_rate &amp;gt; 3 so we use the WHERE rental_rate &amp;gt; 30 in the condition.
&lt;/h2&gt;

&lt;p&gt;Get all movies that have a rental rate greater than $3 and a replacement cost less than $20.&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%2Fp5r3mlc8u7y41o3hw6oq.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%2Fp5r3mlc8u7y41o3hw6oq.png" alt=" " width="800" height="574"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title, rental_rate, Replacement_cost FROM film WHERE rental_rate &amp;gt;3 and replacement_cost &amp;lt; 20;&lt;/p&gt;

&lt;h2&gt;
  
  
  It is same as the previous promblem in extra we fetch a replacement_cost and using the condition replacement_cost &amp;lt; 20.
&lt;/h2&gt;

&lt;p&gt;Get all movies that are either rated as 'PG' or have a rental rate of $0.99.&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%2Fo7swbdd99iejpv5cy2co.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%2Fo7swbdd99iejpv5cy2co.png" alt=" " width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT rating, rental_rate FROM film WHERE rating = 'PG' or rental_rate = 0.99;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to fetch the rating and rental_rate from film table and with the condition rating = 'PG' or rental_rate = 0.99.
&lt;/h2&gt;

&lt;p&gt;Show the first 10 movies sorted by rental rate (highest first).&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%2Fdaslgk1eomh2j51r0obd.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%2Fdaslgk1eomh2j51r0obd.png" alt=" " width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT rental_rate FROM film ORDER BY rental_rate DESC LIMIT 10;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to fetch rental_rate from film table and with the condition of top 10 highest value so we are using decsending order and LIMIT 10 to the top 10 highest value.
&lt;/h2&gt;

&lt;p&gt;Skip the first 5 movies and fetch the next 3 sorted by rental rate in ascending order.&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%2Fnzug27lh6uxrariip7rv.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%2Fnzug27lh6uxrariip7rv.png" alt=" " width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title,rental_rate FROM film ORDER BY rental_rate ASC OFFSET 5 LIMIT 3;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to fetch the rental_rate data from film table and to skip the first five and to give the next 3 data sorted in ascending order.
&lt;/h2&gt;

&lt;p&gt;Get all movies with a rental duration between 3 and 7 days.&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%2Fljq6q7unq70k9b271fbv.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%2Fljq6q7unq70k9b271fbv.png" alt=" " width="800" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title, rental_duration FROM film WHERE rental_duration  BETWEEN 3 and 7;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we are fetching the data from title and rental_duration FROM film and that rental_duration must be between 3 and 7.
&lt;/h2&gt;

&lt;p&gt;Get all movies where the title starts with 'A' and ends with 'e'&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%2Fw9hkkti9l0exp50pz9x4.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%2Fw9hkkti9l0exp50pz9x4.png" alt=" " width="800" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title FROM film WHERE title LIKE 'A%e';&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to get the title of movie start with 'A' and ends with 'e' from the film table.
&lt;/h2&gt;

&lt;p&gt;Find all movies where the title contains "Man", "Men", or "Woman".&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%2Fzx09xqzoutpigjwss389.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%2Fzx09xqzoutpigjwss389.png" alt=" " width="800" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title FROM film WHERE title LIKE '%Man%' OR title LIKE '%Men%' OR title LIKE '%Woman%';&lt;/p&gt;

&lt;p&gt;Here, we need to get the title of the movie which contain "MAN","MEN"and "WOMEN" so we used the LIKE'%Man%', LIKE'%Men%' and  LIKE'%Woman%'&lt;/p&gt;




&lt;p&gt;Find all movies where the special features are not listed (i.e., special_features is NULL).&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%2Fh5w3dimrhdazjpphxq5e.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%2Fh5w3dimrhdazjpphxq5e.png" alt=" " width="800" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT * FROM film WHERE special_features IS NULL;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here we use IS NULL to find movies with no special feature.
&lt;/h2&gt;

&lt;p&gt;Find the first 10 movies with a rental rate of $2.99 or $4.99, a rating of 'R', and a title containing the word "L".&lt;/p&gt;

&lt;p&gt;SELECT * FROM film WHERE rental_rate IN (2.99, 4.99) AND rating = 'R' AND title LIKE '%L%' LIMIT 10;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CA 31 - Select Queries from DVD Rental database</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 29 Mar 2026 15:12:37 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-31-select-queries-from-dvd-rental-database-223i</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-31-select-queries-from-dvd-rental-database-223i</guid>
      <description>&lt;p&gt;Retrieve film titles and their rental rates. Use column aliases to rename title as "Movie Title" and rental_rate as "Rate".&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%2Fo9w17xgbtp73d8z8lau1.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%2Fo9w17xgbtp73d8z8lau1.png" alt=" " width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title AS "Movie Title",rental_rate AS "Rate"FROM film;&lt;/p&gt;

&lt;p&gt;Here,title is renamed into Movie Title amd rental_rate is renamed into Rate from film table and to show the output.&lt;/p&gt;




&lt;p&gt;List customer names and their email addresses. Alias first_name and last_name as "First Name" and "Last 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%2Fefqhqluukkfe7lujuek2.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%2Fefqhqluukkfe7lujuek2.png" alt=" " width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT first_name AS "First Name",last_name AS "Last Name",email FROM customer;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, first_name is ranamed into First Name and last_name as Last Name and  fetch the email from the customer table.
&lt;/h2&gt;

&lt;p&gt;Get a list of films sorted by rental rate in descending order. If two films have the same rental rate, sort them alphabetically by title.&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%2F4a07gfzxi0ogy4jqrxx5.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%2F4a07gfzxi0ogy4jqrxx5.png" alt=" " width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title,rental_rate FROM film ORDER BY rental_rate DESC,title ASC;&lt;/p&gt;

&lt;p&gt;Here, title and rental_rate to be fetch from film table and to order the rental_rate to descending order and title as ascending order.&lt;/p&gt;




&lt;p&gt;Retrieve actor names sorted by last name, then first 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%2F01fr9xccfz75hojexsck.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%2F01fr9xccfz75hojexsck.png" alt=" " width="800" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT first_name,last_nameFROM actor ORDER BY last_name ASC,first_name ASC;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, the first_name and last_name to be fetch from actor table and to order the last name and first name in asccending order.
&lt;/h2&gt;

&lt;p&gt;List all unique replacement costs from the film table.&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%2Fz9a520jzqlfr5t0wbhn7.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%2Fz9a520jzqlfr5t0wbhn7.png" alt=" " width="536" height="632"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT DISTINCT replacement_cost FROM film;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, the we need to fetch the unique replacement_cost from the film table so we used DISTINCT in the query.
&lt;/h2&gt;

&lt;p&gt;List all films' title and length in minutes. Alias length as "Duration (min)".&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%2Fe0mg0ws82ela03g1yash.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%2Fe0mg0ws82ela03g1yash.png" alt=" " width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title,length AS "Duration (min)"FROM film;&lt;/p&gt;

&lt;p&gt;Here, from film table the title and the length data to be fetch and to rename the length as Duration(min) so we use length AS "Duration (min)".&lt;/p&gt;




&lt;p&gt;Retrieve customer first and last names along with their active status. Alias active as "Is Active".&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%2F5518di8g87e20izgsn30.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%2F5518di8g87e20izgsn30.png" alt=" " width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT first_name,last_name,active AS "Is Active" FROM customer;&lt;/p&gt;

&lt;p&gt;Here,the  first_name, last_name and active from customer table and to rename the active to Is Active so we use active AS "Is Active".&lt;/p&gt;




&lt;p&gt;Retrieve the list of film categories sorted alphabetically.&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%2Fs0cr2a959bv7thupvtiu.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%2Fs0cr2a959bv7thupvtiu.png" alt=" " width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT name from category order by name ASC;&lt;/p&gt;

&lt;p&gt;Here, to take the list of film name from caregory and to sort the film name in ascending order.&lt;/p&gt;




&lt;p&gt;List films by length, sorted in descending order. Include only the title and length.&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%2F9n18r8bthvvt8jh07mis.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%2F9n18r8bthvvt8jh07mis.png" alt=" " width="800" height="678"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title lenght FROM film ORDER BY title DESC,length DESC;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, list all the title and length from film and to order the title and lenght by descending order.
&lt;/h2&gt;

&lt;p&gt;Retrieve all actor names, sorted by their first name in descending order.&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%2F1qr7u25uu7tgqpz82ffw.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%2F1qr7u25uu7tgqpz82ffw.png" alt=" " width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT first_name FROM actor ORDER BY first_name DESC;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here,from actor table the first_name to be fetch and to order it by descending order.
&lt;/h2&gt;

&lt;p&gt;List all unique ratings available in the film table.&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%2Fukvcahs79m9dtytsptb7.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%2Fukvcahs79m9dtytsptb7.png" alt=" " width="800" height="208"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT DISTINCT rating FROM film;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here,for the unique rating we are using DISTINCT to get unique rating from film table.
&lt;/h2&gt;

&lt;p&gt;Find all unique rental durations from the film table.&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%2Fhie1bicvia1by6fvm4e9.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%2Fhie1bicvia1by6fvm4e9.png" alt=" " width="750" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT DISTINCT  rental_duration FROM film;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here,for the unique rental_duation we are using DISTINCT to get unique rental_duration from film table.
&lt;/h2&gt;

&lt;p&gt;Retrieve the first unique customer ID based on active status. Include the customer_id and active columns, and order by customer_id.&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%2Fv6kk06dv3gcjzb70srni.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%2Fv6kk06dv3gcjzb70srni.png" alt=" " width="800" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT DISTINCT ON (active)customer_id,active FROM customer ORDER BY active,customer_id;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here,we are fetching the data from customer which must give unique customer_id which must be active that means this query gives the customer_id which are in active.
&lt;/h2&gt;

&lt;p&gt;List the earliest rental date for each customer. Include customer_id and rental_date, and order by customer_id.&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%2Fo4l060rwakucwmh8eoy9.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%2Fo4l060rwakucwmh8eoy9.png" alt=" " width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT customer_id,MIN(rental_date) AS rental_date FROM rental GROUP BY customer_id ORDER BY customer_id;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to fetch the earliest rental data so we are using MIN(rental_date) and also including the customer_id and rental_date which must be in the order of customer_id from rental table.
&lt;/h2&gt;

&lt;p&gt;List the 10 shortest films by length. Include the title and length.&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%2F3tum99swqorgm934y6ao.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%2F3tum99swqorgm934y6ao.png" alt=" " width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT title,length FROM film LIMIT 10;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to fetch the title, length from the film table and it should be shortest of 10 films so using LIMIt 10.
&lt;/h2&gt;

&lt;p&gt;Retrieve all unique values of store_id from the inventory table.&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%2Fvgsgauk4xrfjfr7ca5yz.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%2Fvgsgauk4xrfjfr7ca5yz.png" alt=" " width="800" height="141"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT DISTINCT store_id FROM inventory;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to fetch unique store_id from inventory table so we are using DISTINCT store_id.
&lt;/h2&gt;

&lt;p&gt;Find all unique replacement_cost values in the film table. Sort the results in ascending order.&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%2Fbmlkahgo8menvivfdygv.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%2Fbmlkahgo8menvivfdygv.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SELECT DISTINCT replacement_cost FROM film ORDER BY replacement_cost ASC;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here, we need to select unique replacement_cost from film table and that cost should be in ascending order, for unique replacement_cost we are usihg DISTINCT replacement_cost in the query.
&lt;/h2&gt;

</description>
    </item>
    <item>
      <title>CA 30 - Basic Select SQL Queries</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Thu, 26 Mar 2026 18:21:25 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-30-basic-select-sql-queries-hi9</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-30-basic-select-sql-queries-hi9</guid>
      <description>&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%2Fhpbqqr3zq95r05z6k49h.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%2Fhpbqqr3zq95r05z6k49h.png" alt=" " width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The questions is to query all the attributes in city table so i us&lt;br&gt;
[SELECT * from city]&lt;br&gt;
*-&amp;gt;denotes all the attribute(columns) for every row&lt;br&gt;
from-&amp;gt;from the table city.&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%2F5zx7u0ld66ln0snmih8j.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%2F5zx7u0ld66ln0snmih8j.png" alt=" " width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The question is the query only the names of japanese city from the city by using the countrycode JPN.&lt;br&gt;
[select name from city where countrycode = 'JPN';]&lt;br&gt;
name-&amp;gt;they only names of japanese city from city table&lt;br&gt;
where-&amp;gt;show the condition where the query to fetch the name(only japanese so they gave countrycode in the question) by using the country code we can take japanese 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%2F8ihzxk55q44p3s9b225d.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%2F8ihzxk55q44p3s9b225d.png" alt=" " width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This question is same as the previous one, here they ask american cities by using countrycode = 'USA' and also with the population &amp;gt; 100000&lt;br&gt;
[select * from city where population&amp;gt;100000 and countrycode='USA';]&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%2Fru2v1jcihp0xa8xrwhzg.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%2Fru2v1jcihp0xa8xrwhzg.png" alt=" " width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this question they ask all city names from the table station but the condition is do not start with vowels and not to repeat duplicates.&lt;br&gt;
for not repeat duplicate we use distinct and not include the words starting with vowels so we use NOT LIKE&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%2F6s1ftt8mj3hozriy7gun.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%2F6s1ftt8mj3hozriy7gun.png" alt=" " width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is same as 3rd problem in the blog.Here, the difference is population &amp;gt; 120000 and all other query are same.&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%2Fes0c3z85i2dbzkew0dbr.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%2Fes0c3z85i2dbzkew0dbr.png" alt=" " width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is same as the 2nd question in the blog there is no difference between these two questions.&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%2Fxxbtnahycy8lilbkkzfk.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%2Fxxbtnahycy8lilbkkzfk.png" alt=" " width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this question they ask the query all the city with ID=1661 from the CITY table.&lt;br&gt;
[select * from city where ID=1661;]&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%2Fwuerqa4rqhmb6p9b7ls1.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%2Fwuerqa4rqhmb6p9b7ls1.png" alt=" " width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, they ask to  query the list of CITY and STATE from the table STATION.so the query is&lt;br&gt;
[Select city,state from station;]&lt;/p&gt;

</description>
    </item>
    <item>
      <title>BACKEND-DAY:01-CLASS BLOG</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Wed, 25 Mar 2026 17:48:59 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/backend-day01-class-blog-4329</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/backend-day01-class-blog-4329</guid>
      <description>&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%2F5a5uerz5xjvpqp65ljgk.jpeg" 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%2F5a5uerz5xjvpqp65ljgk.jpeg" alt=" " width="800" height="476"&gt;&lt;/a&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%2Fi99cpy2l2pmjt6z6ga2e.jpeg" 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%2Fi99cpy2l2pmjt6z6ga2e.jpeg" alt=" " width="800" height="1508"&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%2Ftsfddbs0mu07k07xd9e9.jpeg" 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%2Ftsfddbs0mu07k07xd9e9.jpeg" alt=" " width="800" height="1430"&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%2Fpt3m6y2ftudam7tjs8e0.jpeg" 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%2Fpt3m6y2ftudam7tjs8e0.jpeg" alt=" " width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Write a blog on IP address and Subnet</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Mon, 23 Mar 2026 15:32:15 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/write-a-blog-on-ip-address-and-subnet-1p53</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/write-a-blog-on-ip-address-and-subnet-1p53</guid>
      <description>&lt;p&gt;Internet: It means a small group networks connected together.&lt;br&gt;
Example: city-A,city-B,city-C,....etc are connected by roads&lt;br&gt;
working:&lt;br&gt;
send request from your device and goes through router across the network and reaches the server and get response.&lt;/p&gt;

&lt;p&gt;IP - Internet Protocol&lt;br&gt;
it is unique for very device&lt;br&gt;
eg: like a mobile number&lt;/p&gt;

&lt;p&gt;types of ip:&lt;br&gt;
  1.public ip : &lt;br&gt;
  2.private ip : college network...(wifi)&lt;/p&gt;

&lt;p&gt;eg: 192.168.1.10&lt;br&gt;
__&lt;strong&gt;&lt;em&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;.&lt;/em&gt;&lt;strong&gt;&lt;em&gt;.&lt;/em&gt;&lt;/strong&gt;_&lt;/p&gt;

&lt;p&gt;Subnet: breaking a big network into small parts.&lt;br&gt;
IP:192.168.1.10&lt;br&gt;
Subnet: 255.255.255.0&lt;br&gt;
network id:192.168.1&lt;br&gt;
host id:10&lt;/p&gt;

&lt;p&gt;subnets:192.168.1.1&lt;br&gt;
192.168.1.2&lt;br&gt;
192.168.1.3&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CA 15 - Merge Two Linked List</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 22 Mar 2026 09:50:33 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-15-merge-two-linked-list-4adm</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-15-merge-two-linked-list-4adm</guid>
      <description>&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%2Fgyemc18rcgsn0o65i9cf.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%2Fgyemc18rcgsn0o65i9cf.png" alt=" " width="800" height="749"&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%2Fjsg5ylkpxocivxbl1zq0.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%2Fjsg5ylkpxocivxbl1zq0.png" alt=" " width="800" height="813"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Problem&lt;br&gt;
You are given two sorted linked lists:&lt;br&gt;
list1&lt;br&gt;
list2&lt;br&gt;
Merge them into one sorted linked list.&lt;/p&gt;

&lt;p&gt;Correct Idea (Two Pointers)&lt;br&gt;
create new nodes.&lt;br&gt;
relink existing nodes.&lt;br&gt;
Core Logic:&lt;br&gt;
Compare current nodes of both lists&lt;br&gt;
Attach the smaller one&lt;br&gt;
Move forward&lt;br&gt;
Repeat&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CA 07 - Kth Smallest</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 22 Mar 2026 09:44:27 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-07-kth-smallest-4mn3</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-07-kth-smallest-4mn3</guid>
      <description>&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%2F35ojne0ai0vtxfjcjs3h.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%2F35ojne0ai0vtxfjcjs3h.png" alt=" " width="800" height="750"&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%2Fap654vk22o8o3bvr6x6j.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%2Fap654vk22o8o3bvr6x6j.png" alt=" " width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Problem Statement&lt;br&gt;
Given:&lt;br&gt;
An array arr[]&lt;br&gt;
An integer k&lt;br&gt;
Find the k-th smallest element.&lt;br&gt;
Example:&lt;br&gt;
Input:  arr = [10, 5, 4, 3, 48, 6], k = 4&lt;br&gt;
Output: 5&lt;/p&gt;

&lt;p&gt;Approach Max Heap (Priority Queue)&lt;br&gt;
Idea:&lt;br&gt;
Keep only k smallest elements&lt;br&gt;
Use a max heap of size kHow It Works&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;arr = [10, 5, 4, 3, 48, 6]&lt;br&gt;
k = 4&lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;p&gt;Keep pushing into heap&lt;br&gt;
Maintain only 4 smallest elements&lt;br&gt;
Final heap contains smallest 4&lt;br&gt;
Top = answer&lt;/p&gt;

&lt;p&gt;If a smaller element comes replace the largest in heap&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>CA 06 - Find the Maximum and Minimum Element in the Array</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 22 Mar 2026 09:38:28 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-06-find-the-maximum-and-minimum-element-in-the-array-28cc</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-06-find-the-maximum-and-minimum-element-in-the-array-28cc</guid>
      <description>&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%2F6msr7gra0ic80xgbjysf.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%2F6msr7gra0ic80xgbjysf.png" alt=" " width="800" height="752"&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%2Fpkl5ersgstqu0sl45z4z.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%2Fpkl5ersgstqu0sl45z4z.png" alt=" " width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Problem Statement&lt;br&gt;
Given an array, find:&lt;/p&gt;

&lt;p&gt;The minimum element&lt;br&gt;
The maximum element&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
Input:  [1, 4, 3, 8, 6]&lt;br&gt;
Output: [1, 8]&lt;/p&gt;

&lt;p&gt;Approach &lt;br&gt;
You only need one loop.&lt;/p&gt;

&lt;p&gt;Idea:&lt;br&gt;
Assume first element is both min and max&lt;br&gt;
Traverse the array&lt;br&gt;
Update values when needed&lt;/p&gt;

&lt;p&gt;Step-by-Step Example&lt;br&gt;
Input:&lt;br&gt;
[1, 4, 3, 8, 6]&lt;br&gt;
Process:&lt;br&gt;
Start → min = 1, max = 1&lt;br&gt;
4 → max = 4&lt;br&gt;
3 → no change&lt;br&gt;
8 → max = 8&lt;br&gt;
6 → no change&lt;br&gt;
Final:&lt;br&gt;
[1, 8]&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CA 05 - Reverse the array</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 22 Mar 2026 09:32:37 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-05-reverse-the-array-k1f</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-05-reverse-the-array-k1f</guid>
      <description>&lt;p&gt;Reverse an Array — The Simplest Problem You’re Still Overthinking&lt;/p&gt;

&lt;p&gt;Problem:&lt;br&gt;
Given an array, reverse it.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First → Last&lt;/li&gt;
&lt;li&gt;Second → Second Last&lt;/li&gt;
&lt;li&gt;and so on ([GeeksforGeeks][1])&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
Input → &lt;code&gt;[1, 4, 3, 2, 6, 5]&lt;/code&gt;&lt;br&gt;
Output → &lt;code&gt;[5, 6, 2, 3, 4, 1]&lt;/code&gt; ([GeeksforGeeks][2])&lt;/p&gt;

&lt;p&gt;Code (Clean &amp;amp; Correct)&lt;/p&gt;

&lt;p&gt;class Solution:&lt;br&gt;
    def reverseArray(self, arr):&lt;br&gt;
        left = 0&lt;br&gt;
        right = len(arr) - 1&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    while left &amp;lt; right:
        arr[left], arr[right] = arr[right], arr[left]
        left += 1
        right -= 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>CA 08 - Sort 0s, 1s, and 2s</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 22 Mar 2026 08:43:09 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-08-sort-0s-1s-and-2s-4370</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-08-sort-0s-1s-and-2s-4370</guid>
      <description>&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%2Fianzcm1giw05tlzpdl07.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%2Fianzcm1giw05tlzpdl07.png" alt=" " width="800" height="725"&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%2Fwwxzp21bbkcsf7qa0699.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%2Fwwxzp21bbkcsf7qa0699.png" alt=" " width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Problem:&lt;br&gt;
Given an array containing only 0s, 1s, and 2s, sort it without using any built-in sort function.&lt;/p&gt;

&lt;p&gt;Solution: Dutch National Flag Algorithm&lt;br&gt;
We divide the array into three regions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Left → all 0s&lt;/li&gt;
&lt;li&gt;Middle → all 1s&lt;/li&gt;
&lt;li&gt;Right → all 2s
We maintain 3 pointers:&lt;/li&gt;
&lt;li&gt;low → next position for 0&lt;/li&gt;
&lt;li&gt;mid → current element&lt;/li&gt;
&lt;li&gt;high → next position for 2&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 Algorithm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If current is 0 → swap with &lt;code&gt;low&lt;/code&gt;, move both forward&lt;/li&gt;
&lt;li&gt;If current is 1 → move &lt;code&gt;mid&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;If current is 2 → swap with &lt;code&gt;high&lt;/code&gt;, move &lt;code&gt;high&lt;/code&gt; backward&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code:&lt;br&gt;
python&lt;br&gt;
class Solution:&lt;br&gt;
    def sort012(self, arr):&lt;br&gt;
        low, mid = 0, 0&lt;br&gt;
        high = len(arr) - 1&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    while mid &amp;lt;= high:
        if arr[mid] == 0:
            arr[low], arr[mid] = arr[mid], arr[low]
            low += 1
            mid += 1
        elif arr[mid] == 1:
            mid += 1
        else:
            arr[mid], arr[high] = arr[high], arr[mid]
            high -= 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>python</category>
    </item>
    <item>
      <title>CA 09 - Move All Negative Elements to end</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 22 Mar 2026 08:35:31 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-09-move-all-negative-elements-to-end-1hpg</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-09-move-all-negative-elements-to-end-1hpg</guid>
      <description>&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%2Fa4h38y9yvinl717y6n07.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%2Fa4h38y9yvinl717y6n07.png" alt=" " width="800" height="743"&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%2F6h6qn0reexcx6o58zk4m.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%2F6h6qn0reexcx6o58zk4m.png" alt=" " width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Problem:&lt;br&gt;
Keep order of positives SAME&lt;br&gt;
Keep order of negatives SAME&lt;br&gt;
Move all negatives to the end&lt;/p&gt;

&lt;p&gt;This means:&lt;/p&gt;

&lt;p&gt;You need a stable partition&lt;br&gt;
 NOT swapping randomly like quicksort&lt;/p&gt;

&lt;p&gt;Correct Approach (Simple &amp;amp; Clean)&lt;br&gt;
Idea:&lt;br&gt;
First collect all positive numbers&lt;br&gt;
Then collect all negative numbers&lt;br&gt;
Put back into array&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;Input:&lt;br&gt;
[1, -1, 3, 2, -7, -5, 11, 6]&lt;br&gt;
Step:&lt;br&gt;
positives → [1, 3, 2, 11, 6]&lt;br&gt;
negatives → [-1, -7, -5]&lt;br&gt;
Final:&lt;br&gt;
[1, 3, 2, 11, 6, -1, -7, -5]&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CA 10 - Kadanes Algorithm</title>
      <dc:creator>VARUN</dc:creator>
      <pubDate>Sun, 22 Mar 2026 08:23:04 +0000</pubDate>
      <link>https://dev.to/varun_924260e48ba54f2360e/ca-10-kadanes-algorithm-1cgj</link>
      <guid>https://dev.to/varun_924260e48ba54f2360e/ca-10-kadanes-algorithm-1cgj</guid>
      <description>&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%2Fp8zl1y72tfm5txp68wjk.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%2Fp8zl1y72tfm5txp68wjk.png" alt=" " width="800" height="762"&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%2Ftwkwn6yx48a26td3v85w.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%2Ftwkwn6yx48a26td3v85w.png" alt=" " width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Problem&lt;br&gt;
Given an array of integers.&lt;br&gt;
The Task is to find the maximum sum of a contiguous subarray.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
Input: [2, 3, -8, 7, -1, 2, 3]&lt;br&gt;
Output: 11&lt;/p&gt;

&lt;p&gt;Idea&lt;br&gt;
If your current sum becomes negative:&lt;br&gt;
Drop it immediately&lt;br&gt;
Start fresh from next element&lt;/p&gt;

&lt;p&gt;Algorithm Logic&lt;br&gt;
At each index:&lt;/p&gt;

&lt;p&gt;current_sum = max(arr[i], current_sum + arr[i])&lt;br&gt;
max_sum = max(max_sum, current_sum)&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;Array:&lt;br&gt;
[2, 3, -8, 7, -1, 2, 3]&lt;br&gt;
Step-by-step:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with 2 → current = 2&lt;/li&gt;
&lt;li&gt;Add 3 → current = 5&lt;/li&gt;
&lt;li&gt;Add -8 → current = -3 ❌ (bad → drop)&lt;/li&gt;
&lt;li&gt;Start fresh at 7 → current = 7&lt;/li&gt;
&lt;li&gt;Add -1 → current = 6&lt;/li&gt;
&lt;li&gt;Add 2 → current = 8&lt;/li&gt;
&lt;li&gt;Add 3 → current = 11 ✅&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;answer = 11&lt;/p&gt;

&lt;p&gt;Python Code&lt;br&gt;
class Solution:&lt;br&gt;
    def maxSubarraySum(self, arr):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    max_sum = arr[0]
    current_sum = arr[0]

    for i in range(1, len(arr)):
        current_sum = max(arr[i], current_sum + arr[i])
        max_sum = max(max_sum, current_sum)

    return max_sum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;All numbers are negative:&lt;br&gt;
[-2, -4]&lt;br&gt;
Answer = &lt;strong&gt;-2&lt;/strong&gt; (not 0)&lt;br&gt;
max_sum = arr[0]&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
