SlideShare a Scribd company logo
6
Most read
14
Most read
17
Most read
WEB DEVELOPMENT
PHP
PRESENTATORS
MD. AL-MAMUN SARKAR
SQL
Structured Query Language
Why SQL
Execute queries against a database
Retrieve data from a database
Insert records in a database
Update records in a database
Delete records from a database
Create new databases
Create new tables in a database
Create views in a database
Important SQL Commands
 SELECT - extracts data from a database
 UPDATE - updates data in a database
 DELETE - deletes data from a database
 INSERT INTO - inserts new data into a database
 CREATE DATABASE - creates a new database
 ALTER DATABASE - modifies a database
 CREATE TABLE - creates a new table
 ALTER TABLE - modifies a table
 DROP TABLE - deletes a table
 CREATE INDEX - creates an index (search key)
 DROP INDEX - deletes an index
Select
SELECT * FROM table_name;
SELECT column1, column2, ...
FROM table_name;
SELECT DISTINCT
SELECT DISTINCT column_name FROM
table_name;
WHERE Clause
SELECT column1, column2, ...
FROM table_name
WHERE condition;
Example:
SELECT * FROM students
WHERE age='15';
Operators
 = Equal
 <> Not equal. Note: ( != )
 > Greater than
 < Less than
 >= Greater than or equal
 <= Less than or equal
 BETWEEN Between an inclusive range
 LIKE Search for a pattern
 IN To specify multiple possible values for a column
AND, OR and NOT
AND
SELECT * FROM table_name
WHERE condition1 AND condition2 AND condition3;
OR
SELECT * FROM table_name
WHERE condition1 OR condition2 OR condition3 ;
NOT
SELECT * FROM table_name
WHERE NOT condition;
ORDER BY
SELECT column1, column2, ...
FROM table_name
ORDER BY column ASC/DESC;
Example:
SELECT * FROM students ORDER BY id;
SELECT * FROM students ORDER BY id ASC;
SELECT * FROM students ORDER BY id DESC;
NULL
SELECT column_names
FROM table_name
WHERE column_name IS NULL;
SELECT column_names
FROM table_name
WHERE column_name IS NOT NULL;
INSERT
INSERT INTO table_name (column1, column2,
column3, ...)
VALUES (value1, value2, value3, ...);
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
UPDATE
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
DELETE
DELETE FROM table_name
WHERE condition;
DELETE FROM table_name;
DELETE * FROM table_name;
QUESTION
?
THANK
YOU
Ad

Recommended

MySQL ppt
MySQL ppt
AtharvaSawant10
 
Database Management System ppt
Database Management System ppt
OECLIB Odisha Electronics Control Library
 
Introduction to SQL
Introduction to SQL
Ehsan Hamzei
 
Code of Conduct
Code of Conduct
Katherine Chin
 
MS ACCESS PPT.pptx
MS ACCESS PPT.pptx
sourav mathur
 
Er model ppt
Er model ppt
Pihu Goel
 
Data Modeling PPT
Data Modeling PPT
Trinath
 
Microsoft Word: Working with Tables
Microsoft Word: Working with Tables
Tiffany Johnson
 
Sql clauses by Manan Pasricha
Sql clauses by Manan Pasricha
MananPasricha
 
PL/SQL TRIGGERS
PL/SQL TRIGGERS
Lakshman Basnet
 
SQL - DML and DDL Commands
SQL - DML and DDL Commands
Shrija Madhu
 
Constraints In Sql
Constraints In Sql
Anurag
 
Nested Queries Lecture
Nested Queries Lecture
Felipe Costa
 
Introduction to database & sql
Introduction to database & sql
zahid6
 
Integrity Constraints
Integrity Constraints
Megha yadav
 
SQL Queries Information
SQL Queries Information
Nishant Munjal
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Integrity constraints in dbms
Integrity constraints in dbms
Vignesh Saravanan
 
Sql commands
Sql commands
Pooja Dixit
 
SQL
SQL
Vineeta Garg
 
Stored procedure
Stored procedure
baabtra.com - No. 1 supplier of quality freshers
 
What is SQL Server?
What is SQL Server?
CPD INDIA
 
SQL commands
SQL commands
GirdharRatne
 
Aggregate functions
Aggregate functions
sinhacp
 
8. sql
8. sql
khoahuy82
 
Database Triggers
Database Triggers
Aliya Saldanha
 
SQL Commands
SQL Commands
Sachidananda M H
 
SQL JOIN
SQL JOIN
Ritwik Das
 
Introduction to SQL
Introduction to SQL
Mahir Haque
 
Lesson-02 (1).pptx
Lesson-02 (1).pptx
ssuserc24e05
 

More Related Content

What's hot (20)

Sql clauses by Manan Pasricha
Sql clauses by Manan Pasricha
MananPasricha
 
PL/SQL TRIGGERS
PL/SQL TRIGGERS
Lakshman Basnet
 
SQL - DML and DDL Commands
SQL - DML and DDL Commands
Shrija Madhu
 
Constraints In Sql
Constraints In Sql
Anurag
 
Nested Queries Lecture
Nested Queries Lecture
Felipe Costa
 
Introduction to database & sql
Introduction to database & sql
zahid6
 
Integrity Constraints
Integrity Constraints
Megha yadav
 
SQL Queries Information
SQL Queries Information
Nishant Munjal
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Integrity constraints in dbms
Integrity constraints in dbms
Vignesh Saravanan
 
Sql commands
Sql commands
Pooja Dixit
 
SQL
SQL
Vineeta Garg
 
Stored procedure
Stored procedure
baabtra.com - No. 1 supplier of quality freshers
 
What is SQL Server?
What is SQL Server?
CPD INDIA
 
SQL commands
SQL commands
GirdharRatne
 
Aggregate functions
Aggregate functions
sinhacp
 
8. sql
8. sql
khoahuy82
 
Database Triggers
Database Triggers
Aliya Saldanha
 
SQL Commands
SQL Commands
Sachidananda M H
 
SQL JOIN
SQL JOIN
Ritwik Das
 

Similar to Database Management - Lecture 2 - SQL select, insert, update and delete (20)

Introduction to SQL
Introduction to SQL
Mahir Haque
 
Lesson-02 (1).pptx
Lesson-02 (1).pptx
ssuserc24e05
 
Learning SQL
Learning SQL
David Raudales
 
Learning SQL
Learning SQL
DAVID RAUDALES
 
SQl data base management and design
SQl data base management and design
franckelsania20
 
Introduction to structured query language
Introduction to structured query language
Huda Alameen
 
MY SQL
MY SQL
sundar
 
SQL Commands
SQL Commands
Divyank Jindal
 
Sql
Sql
Atul Pant
 
SQL | DML
SQL | DML
To Sum It Up
 
Its about a sql topic for basic structured query language
Its about a sql topic for basic structured query language
IMsKanchanaI
 
SQL. It education ppt for reference sql process coding
SQL. It education ppt for reference sql process coding
aditipandey498628
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
Newyorksys.com
 
about-SQL AND ETC.pptx
about-SQL AND ETC.pptx
jwhuqyqtayaw
 
SQL report
SQL report
Ahmad Zahid
 
SQL Assessment Command Statements
SQL Assessment Command Statements
Shaun Wilson
 
SQL
SQL
Jerin John
 
SQL
SQL
Jerin John
 
Sql slid
Sql slid
pacatarpit
 
full detailled SQL notesquestion bank (1).pdf
full detailled SQL notesquestion bank (1).pdf
yvpachorib23
 
Introduction to SQL
Introduction to SQL
Mahir Haque
 
Lesson-02 (1).pptx
Lesson-02 (1).pptx
ssuserc24e05
 
SQl data base management and design
SQl data base management and design
franckelsania20
 
Introduction to structured query language
Introduction to structured query language
Huda Alameen
 
Its about a sql topic for basic structured query language
Its about a sql topic for basic structured query language
IMsKanchanaI
 
SQL. It education ppt for reference sql process coding
SQL. It education ppt for reference sql process coding
aditipandey498628
 
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
Newyorksys.com
 
about-SQL AND ETC.pptx
about-SQL AND ETC.pptx
jwhuqyqtayaw
 
SQL Assessment Command Statements
SQL Assessment Command Statements
Shaun Wilson
 
full detailled SQL notesquestion bank (1).pdf
full detailled SQL notesquestion bank (1).pdf
yvpachorib23
 
Ad

More from Al-Mamun Sarkar (20)

01 Introductions to System Design
01 Introductions to System Design
Al-Mamun Sarkar
 
Introduction to machine learning
Introduction to machine learning
Al-Mamun Sarkar
 
Software Development Life Cycle (SDLC)
Software Development Life Cycle (SDLC)
Al-Mamun Sarkar
 
Understanding Wordpress Plugn and Theme users' behavior
Understanding Wordpress Plugn and Theme users' behavior
Al-Mamun Sarkar
 
Database Management - Lecture 4 - PHP and Mysql
Database Management - Lecture 4 - PHP and Mysql
Al-Mamun Sarkar
 
Database Management - Lecture 3 - SQL Aggregate Functions, Join
Database Management - Lecture 3 - SQL Aggregate Functions, Join
Al-Mamun Sarkar
 
Database Management - Lecture 1
Database Management - Lecture 1
Al-Mamun Sarkar
 
PHP Lecture 6 - Php file uploading
PHP Lecture 6 - Php file uploading
Al-Mamun Sarkar
 
PHP Lecture 5 - Date time, Include, session
PHP Lecture 5 - Date time, Include, session
Al-Mamun Sarkar
 
PHP Lecture 4 - Working with form, GET and Post Methods
PHP Lecture 4 - Working with form, GET and Post Methods
Al-Mamun Sarkar
 
PHP Lecture 3 - Functions
PHP Lecture 3 - Functions
Al-Mamun Sarkar
 
PHP Lecture 2 - Conditional Statement, Loop
PHP Lecture 2 - Conditional Statement, Loop
Al-Mamun Sarkar
 
PHP Lecture 1 - String, Constants, Arrays, Operators
PHP Lecture 1 - String, Constants, Arrays, Operators
Al-Mamun Sarkar
 
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
Al-Mamun Sarkar
 
Web Design Course - Lecture 20 - Bootstrap Dropdown, Button group, Input grou...
Web Design Course - Lecture 20 - Bootstrap Dropdown, Button group, Input grou...
Al-Mamun Sarkar
 
Web Design Course - Lecture 18 - Boostrap, Gatting started, grid system, tables
Web Design Course - Lecture 18 - Boostrap, Gatting started, grid system, tables
Al-Mamun Sarkar
 
Web Design Course - Lecture 11 - CSS3, Border radius, Box shadow
Web Design Course - Lecture 11 - CSS3, Border radius, Box shadow
Al-Mamun Sarkar
 
Web Design Course - Lecture 10 - Floating, Align, navigation bar, Image galle...
Web Design Course - Lecture 10 - Floating, Align, navigation bar, Image galle...
Al-Mamun Sarkar
 
Web Design Course - Lecture 9 - Border, Padding and Margin, Display
Web Design Course - Lecture 9 - Border, Padding and Margin, Display
Al-Mamun Sarkar
 
Web Design Course - Lecture 7 - Basic Css
Web Design Course - Lecture 7 - Basic Css
Al-Mamun Sarkar
 
01 Introductions to System Design
01 Introductions to System Design
Al-Mamun Sarkar
 
Introduction to machine learning
Introduction to machine learning
Al-Mamun Sarkar
 
Software Development Life Cycle (SDLC)
Software Development Life Cycle (SDLC)
Al-Mamun Sarkar
 
Understanding Wordpress Plugn and Theme users' behavior
Understanding Wordpress Plugn and Theme users' behavior
Al-Mamun Sarkar
 
Database Management - Lecture 4 - PHP and Mysql
Database Management - Lecture 4 - PHP and Mysql
Al-Mamun Sarkar
 
Database Management - Lecture 3 - SQL Aggregate Functions, Join
Database Management - Lecture 3 - SQL Aggregate Functions, Join
Al-Mamun Sarkar
 
Database Management - Lecture 1
Database Management - Lecture 1
Al-Mamun Sarkar
 
PHP Lecture 6 - Php file uploading
PHP Lecture 6 - Php file uploading
Al-Mamun Sarkar
 
PHP Lecture 5 - Date time, Include, session
PHP Lecture 5 - Date time, Include, session
Al-Mamun Sarkar
 
PHP Lecture 4 - Working with form, GET and Post Methods
PHP Lecture 4 - Working with form, GET and Post Methods
Al-Mamun Sarkar
 
PHP Lecture 3 - Functions
PHP Lecture 3 - Functions
Al-Mamun Sarkar
 
PHP Lecture 2 - Conditional Statement, Loop
PHP Lecture 2 - Conditional Statement, Loop
Al-Mamun Sarkar
 
PHP Lecture 1 - String, Constants, Arrays, Operators
PHP Lecture 1 - String, Constants, Arrays, Operators
Al-Mamun Sarkar
 
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
Web Design Course - Lecture 21 - Bootstrap Jumbotron, Thumbnails, Alerts, Pro...
Al-Mamun Sarkar
 
Web Design Course - Lecture 20 - Bootstrap Dropdown, Button group, Input grou...
Web Design Course - Lecture 20 - Bootstrap Dropdown, Button group, Input grou...
Al-Mamun Sarkar
 
Web Design Course - Lecture 18 - Boostrap, Gatting started, grid system, tables
Web Design Course - Lecture 18 - Boostrap, Gatting started, grid system, tables
Al-Mamun Sarkar
 
Web Design Course - Lecture 11 - CSS3, Border radius, Box shadow
Web Design Course - Lecture 11 - CSS3, Border radius, Box shadow
Al-Mamun Sarkar
 
Web Design Course - Lecture 10 - Floating, Align, navigation bar, Image galle...
Web Design Course - Lecture 10 - Floating, Align, navigation bar, Image galle...
Al-Mamun Sarkar
 
Web Design Course - Lecture 9 - Border, Padding and Margin, Display
Web Design Course - Lecture 9 - Border, Padding and Margin, Display
Al-Mamun Sarkar
 
Web Design Course - Lecture 7 - Basic Css
Web Design Course - Lecture 7 - Basic Css
Al-Mamun Sarkar
 
Ad

Recently uploaded (20)

OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
 
Artificial Intelligence Workloads and Data Center Management
Artificial Intelligence Workloads and Data Center Management
SandeepKS52
 
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
SAP PM Module Level-IV Training Complete.ppt
SAP PM Module Level-IV Training Complete.ppt
MuhammadShaheryar36
 
A Guide to Telemedicine Software Development.pdf
A Guide to Telemedicine Software Development.pdf
Olivero Bozzelli
 
NVIDIA GPU Technologies for AI and High-Performance Computing
NVIDIA GPU Technologies for AI and High-Performance Computing
SandeepKS52
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Best MLM Compensation Plans for Network Marketing Success in 2025
Best MLM Compensation Plans for Network Marketing Success in 2025
LETSCMS Pvt. Ltd.
 
Key Challenges in Troubleshooting Customer On-Premise Applications
Key Challenges in Troubleshooting Customer On-Premise Applications
Tier1 app
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
The Anti-Masterclass Live - Peak of Data & AI 2025
The Anti-Masterclass Live - Peak of Data & AI 2025
Safe Software
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
 
Artificial Intelligence Workloads and Data Center Management
Artificial Intelligence Workloads and Data Center Management
SandeepKS52
 
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
SAP PM Module Level-IV Training Complete.ppt
SAP PM Module Level-IV Training Complete.ppt
MuhammadShaheryar36
 
A Guide to Telemedicine Software Development.pdf
A Guide to Telemedicine Software Development.pdf
Olivero Bozzelli
 
NVIDIA GPU Technologies for AI and High-Performance Computing
NVIDIA GPU Technologies for AI and High-Performance Computing
SandeepKS52
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Best MLM Compensation Plans for Network Marketing Success in 2025
Best MLM Compensation Plans for Network Marketing Success in 2025
LETSCMS Pvt. Ltd.
 
Key Challenges in Troubleshooting Customer On-Premise Applications
Key Challenges in Troubleshooting Customer On-Premise Applications
Tier1 app
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
The Anti-Masterclass Live - Peak of Data & AI 2025
The Anti-Masterclass Live - Peak of Data & AI 2025
Safe Software
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 

Database Management - Lecture 2 - SQL select, insert, update and delete

  • 3. SQL
  • 5. Why SQL Execute queries against a database Retrieve data from a database Insert records in a database Update records in a database Delete records from a database Create new databases Create new tables in a database Create views in a database
  • 6. Important SQL Commands  SELECT - extracts data from a database  UPDATE - updates data in a database  DELETE - deletes data from a database  INSERT INTO - inserts new data into a database  CREATE DATABASE - creates a new database  ALTER DATABASE - modifies a database  CREATE TABLE - creates a new table  ALTER TABLE - modifies a table  DROP TABLE - deletes a table  CREATE INDEX - creates an index (search key)  DROP INDEX - deletes an index
  • 7. Select SELECT * FROM table_name; SELECT column1, column2, ... FROM table_name;
  • 8. SELECT DISTINCT SELECT DISTINCT column_name FROM table_name;
  • 9. WHERE Clause SELECT column1, column2, ... FROM table_name WHERE condition; Example: SELECT * FROM students WHERE age='15';
  • 10. Operators  = Equal  <> Not equal. Note: ( != )  > Greater than  < Less than  >= Greater than or equal  <= Less than or equal  BETWEEN Between an inclusive range  LIKE Search for a pattern  IN To specify multiple possible values for a column
  • 11. AND, OR and NOT AND SELECT * FROM table_name WHERE condition1 AND condition2 AND condition3; OR SELECT * FROM table_name WHERE condition1 OR condition2 OR condition3 ; NOT SELECT * FROM table_name WHERE NOT condition;
  • 12. ORDER BY SELECT column1, column2, ... FROM table_name ORDER BY column ASC/DESC; Example: SELECT * FROM students ORDER BY id; SELECT * FROM students ORDER BY id ASC; SELECT * FROM students ORDER BY id DESC;
  • 13. NULL SELECT column_names FROM table_name WHERE column_name IS NULL; SELECT column_names FROM table_name WHERE column_name IS NOT NULL;
  • 14. INSERT INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...); INSERT INTO table_name VALUES (value1, value2, value3, ...);
  • 15. UPDATE UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition;
  • 16. DELETE DELETE FROM table_name WHERE condition; DELETE FROM table_name; DELETE * FROM table_name;