SQL_Introduction_PresentatioFDFdfFfn.pptx

dejiw91154 9 views 18 slides May 15, 2025
Slide 1
Slide 1 of 18
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18

About This Presentation

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...


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