<?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: Swetha G</title>
    <description>The latest articles on DEV Community by Swetha G (@swetha_g_9a33288a117e172c).</description>
    <link>https://dev.to/swetha_g_9a33288a117e172c</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3697988%2F46466ace-6b31-4af5-923d-b09b9363e50c.jpg</url>
      <title>DEV Community: Swetha G</title>
      <link>https://dev.to/swetha_g_9a33288a117e172c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/swetha_g_9a33288a117e172c"/>
    <language>en</language>
    <item>
      <title>SQL Masterclass</title>
      <dc:creator>Swetha G</dc:creator>
      <pubDate>Sat, 21 Feb 2026 14:50:10 +0000</pubDate>
      <link>https://dev.to/swetha_g_9a33288a117e172c/sql-masterclass-17i8</link>
      <guid>https://dev.to/swetha_g_9a33288a117e172c/sql-masterclass-17i8</guid>
      <description>&lt;p&gt;**What is SQL?&lt;br&gt;
Databases are used to store vast amounts of data. Just like how programming languages are used to communicate with computers, SQL is the language used to communicate with relational databases.&lt;/p&gt;

&lt;p&gt;What is a query?&lt;br&gt;
A query is simply a question you ask the database—give me these columns, from this table, with these conditions.&lt;/p&gt;

&lt;p&gt;Syntax in SQL&lt;br&gt;
Just like grammar rules in a language, SQL also has rules for writing a query. Think of a SQL statement as a small recipe:&lt;/p&gt;

&lt;p&gt;SELECT        -- columns or calculations&lt;br&gt;
FROM         -- table or view name&lt;br&gt;
WHERE            -- optional filter&lt;br&gt;
GROUP BY       -- optional grouping&lt;br&gt;
HAVING        -- optional, after grouping&lt;br&gt;
ORDER BY       -- optional sorting&lt;br&gt;
LIMIT         -- optional cap&lt;/p&gt;

&lt;p&gt;**Types of SQL Operations&lt;br&gt;
There are a few major types of operations performed on databases. Based on these, SQL statements are categorized as:&lt;/p&gt;

&lt;p&gt;**SQL Categories&lt;br&gt;
Data Definition Language (DDL)&lt;br&gt;
Data Manipulation Language (DML)&lt;br&gt;
Data Query Language (DQL)&lt;br&gt;
Data Control Language (DCL)&lt;br&gt;
Transaction Control Language (TCL)&lt;br&gt;
This will make more sense as you learn each of them below.&lt;/p&gt;

&lt;p&gt;CREAT:&lt;br&gt;
CREATE is the keyword that tells the database you want to create something. In this case, we will use it to create a table.&lt;/p&gt;

&lt;p&gt;To create a table, you need three primary details:&lt;/p&gt;

&lt;p&gt;CREATE Requirements List&lt;br&gt;
The name of the table&lt;br&gt;
The columns/fields to include&lt;br&gt;
The data type of each column&lt;br&gt;
Once this is decided, the syntax is:&lt;/p&gt;

&lt;p&gt;CREATE TABLE table_name (&lt;br&gt;
  column1 data_type,&lt;br&gt;
  column2 data_type,&lt;br&gt;
  ...&lt;br&gt;
);&lt;/p&gt;

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

&lt;p&gt;-- Students table&lt;br&gt;
CREATE TABLE students (&lt;br&gt;
  id INT AUTO_INCREMENT PRIMARY KEY,&lt;br&gt;
  name VARCHAR(100),&lt;br&gt;
  email VARCHAR(100),&lt;br&gt;
  department VARCHAR(10),&lt;br&gt;
  year INT,&lt;br&gt;
  cgpa DECIMAL(3,2),&lt;br&gt;
  city VARCHAR(50),&lt;br&gt;
  admission_date DATE&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;INSERT:&lt;/p&gt;

&lt;p&gt;Now that we have the table, let's insert data into it. You need to specify:&lt;/p&gt;

&lt;p&gt;INSERT Requirements&lt;br&gt;
the columns you're filling, and&lt;br&gt;
the values, in the same order.&lt;br&gt;
INSERT INTO are the keywords used to insert data into a table.&lt;/p&gt;

&lt;p&gt;Basic syntax:&lt;br&gt;
INSERT INTO table_name (column1, column2, column3, ...)&lt;br&gt;
VALUES (value1, value2, value3, ...);&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
-- Insert a single student&lt;br&gt;
INSERT INTO students (name, email, department, year, cgpa, city, admission_date)&lt;br&gt;
VALUES ('Rahul Sharma', '&lt;a href="mailto:rahul@college.edu"&gt;rahul@college.edu&lt;/a&gt;', 'CSE', 3, 8.5, 'Delhi', '2022-08-01');&lt;/p&gt;

&lt;p&gt;-- Insert multiple students at once&lt;br&gt;
INSERT INTO students (name, email, department, year, cgpa, city, admission_date)&lt;br&gt;
VALUES &lt;br&gt;
  ('Priya Patel', '&lt;a href="mailto:priya@college.edu"&gt;priya@college.edu&lt;/a&gt;', 'CSE', 3, 9.2, 'Mumbai', '2022-08-01'),&lt;br&gt;
  ('Amit Kumar', '&lt;a href="mailto:amit@college.edu"&gt;amit@college.edu&lt;/a&gt;', 'ECE', 2, 7.8, 'Bangalore', '2023-08-01'),&lt;br&gt;
  ('Sneha Reddy', '&lt;a href="mailto:sneha@college.edu"&gt;sneha@college.edu&lt;/a&gt;', 'CSE', 4, 8.9, 'Hyderabad', '2021-08-01');&lt;/p&gt;

&lt;p&gt;SELECT&lt;br&gt;
Wait, now that we have the data in the database (DB), let's play around with it. Now, let's first read the data that we inserted. To read the data, we have the SELECT keyword, where you need to mention the following:&lt;/p&gt;

&lt;p&gt;SELECT Components&lt;br&gt;
The table from which the data needs to be fetched&lt;br&gt;
The columns from which data needs to be fetched&lt;br&gt;
Syntax:&lt;br&gt;
SELECT columnName... FROM tableName;&lt;br&gt;
Example:&lt;br&gt;
SELECT name, email, dept FROM Students;&lt;/p&gt;

&lt;p&gt;WHERE&lt;br&gt;
We know how to fetch the data, let's add more power to it. If you want to fetch data based on a condition that's where filters come in. WHERE lets you specify a condition that each row we fetch must satisfy.&lt;/p&gt;

&lt;p&gt;What WHERE does&lt;br&gt;
Filters rows based on the condition specified. For example, you might fetch only students with a CGPA &amp;gt; 8, students enrolled in a particular course, or students taught by a professor named Rajesh.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
SELECT column1, column2, ...&lt;br&gt;
FROM table_name&lt;br&gt;
WHERE ;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
