PPT SQL MAT DEKHOusiness
Career
ata & Analytics
esign
evices & Hardware
conomy & Finance
ducation
ngineering
ntertainment & Humor
nvironment
ood
overnment & Nonprofit
ealth & Medicine
ealthcare
nternetPPT SQL MAT DEKHOusiness
Career
ata & Analytics
esign
evices & Hard...
PPT SQL MAT DEKHOusiness
Career
ata & Analytics
esign
evices & Hardware
conomy & Finance
ducation
ngineering
ntertainment & Humor
nvironment
ood
overnment & Nonprofit
ealth & Medicine
ealthcare
nternetPPT SQL MAT DEKHOusiness
Career
ata & Analytics
esign
evices & Hardware
conomy & Finance
ducation
ngineering
ntertainment & Humor
nvironment
ood
overnment & Nonprofit
ealth & Medicine
ealthcare
nternet
Size: 43.01 KB
Language: en
Added: May 15, 2025
Slides: 18 pages
Slide Content
Introduction to SQL Structured Query Language Overview By Pradyumn Vibhandik
What is SQL? SQL stands for Structured Query Language Used to store, retrieve, and manipulate data in relational databases Enables operations such as creating, updating, and querying databases
SQL Language Categories 1. DML – Data Manipulation Language 2. DDL – Data Definition Language 3. DCL – Data Control Language 4. TCL – Transaction Control Language
DML – Data Manipulation Language Used to manipulate records in a table Commands: - SELECT: Retrieve records - INSERT: Add new records - UPDATE: Modify records - DELETE: Remove records
DDL – Data Definition Language Used to define and modify database structure Commands: - CREATE: Create database or table - ALTER: Modify existing structure - DROP: Delete database or table
DCL – Data Control Language Manages permissions and access control Commands: - GRANT: Give user access - REVOKE: Remove access
TCL – Transaction Control Language Manages transactions and data integrity Commands: - BEGIN: Starts a transaction - COMMIT: Saves the transaction - ROLLBACK: Reverts the transaction
SQL Database Commands CREATE DATABASE database_name; DROP DATABASE database_name;
Creating a Table CREATE TABLE Students ( ID INT PRIMARY KEY, Name VARCHAR(100), Age INT, Grade VARCHAR(10) );
SQL Clauses & Keywords (1/2) SELECT: Retrieve data FROM: Specify the table WHERE: Filter records ORDER BY: Sort results
SQL Clauses & Keywords (2/2) GROUP BY: Group rows by value HAVING: Filter grouped records
UPDATE Example UPDATE Students SET Age = 20 WHERE ID = 1;
Window Functions Perform calculations across related rows Do not aggregate rows like GROUP BY Examples: - ROW_NUMBER(), RANK(), DENSE_RANK() - SUM(), AVG(), MAX() over a window
Ranking Example SELECT Name, Grade, RANK() OVER (PARTITION BY Grade ORDER BY Age DESC) AS RankByAge FROM Students;
Running Total Example SELECT Name, Grade, Marks, SUM(Marks) OVER (PARTITION BY Grade ORDER BY Name) AS RunningTotal FROM Students;
Average Example SELECT Name, Grade, Age, AVG(Age) OVER (PARTITION BY Grade) AS AvgAgePerGrade FROM Students;
Max Value Example SELECT Name, Grade, Marks, MAX(Marks) OVER (PARTITION BY Grade) AS MaxMarksInGrade FROM Students;
Thank You Questions? Contact: [email protected] LinkedIn: linkedin.com/in/pradyumn-vibhandik