14
Most read
15
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

More Related Content

PPT
MySQL ppt
PPTX
Database Management System ppt
PPTX
Introduction to SQL
PDF
Nursery all papers
PPTX
Er model ppt
PPTX
MS ACCESS PPT.pptx
PPTX
Smart city presentation
DOC
Nhận Dạng Ngôn Ngữ Ký Hiệu Tiếng Việt.doc
MySQL ppt
Database Management System ppt
Introduction to SQL
Nursery all papers
Er model ppt
MS ACCESS PPT.pptx
Smart city presentation
Nhận Dạng Ngôn Ngữ Ký Hiệu Tiếng Việt.doc

What's hot (20)

PPTX
sql function(ppt)
PPTX
SQL Joins.pptx
PPT
Introduction to structured query language (sql)
PPTX
introdution to SQL and SQL functions
PPTX
SQL JOIN
PPT
Introduction to-sql
PPTX
SQL Functions
PPTX
SQL Basics
PPT
Sql ppt
PPT
Introduction to sql
PPT
Joins in SQL
PPTX
SQL for interview
PPT
SQL Tutorial - Basic Commands
PDF
Oracle SQL Basics
PPTX
Sql and Sql commands
PPT
Sql join
PPT
SQL Queries
sql function(ppt)
SQL Joins.pptx
Introduction to structured query language (sql)
introdution to SQL and SQL functions
SQL JOIN
Introduction to-sql
SQL Functions
SQL Basics
Sql ppt
Introduction to sql
Joins in SQL
SQL for interview
SQL Tutorial - Basic Commands
Oracle SQL Basics
Sql and Sql commands
Sql join
SQL Queries
Ad

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

PDF
full detailled SQL notesquestion bank (1).pdf
PPTX
Avinash database
PPTX
MySqL_n.pptx edshdshfbhjbdhcbjdchdchjcdbbjd
DOCX
Farheen abdul hameed ip project (MY SQL);
DOCX
PDF
Sql Basics | Edureka
PPTX
PPTX
SQl data base management and design
PPTX
MySQL.pptx comuterscience from kvsbbsrs.
PPTX
PPTX
PPTX
SQL Tutorial for Beginners
PPTX
SQL : Structured Query Language
PPT
Mysql 120831075600-phpapp01
PPTX
PPTX
DBMS: Week 06 - SQL - Data Manipulation Language (DML)
DOCX
COMPUTERS SQL
PPTX
Sql commands
PPTX
Its about a sql topic for basic structured query language
PPTX
full detailled SQL notesquestion bank (1).pdf
Avinash database
MySqL_n.pptx edshdshfbhjbdhcbjdchdchjcdbbjd
Farheen abdul hameed ip project (MY SQL);
Sql Basics | Edureka
SQl data base management and design
MySQL.pptx comuterscience from kvsbbsrs.
SQL Tutorial for Beginners
SQL : Structured Query Language
Mysql 120831075600-phpapp01
DBMS: Week 06 - SQL - Data Manipulation Language (DML)
COMPUTERS SQL
Sql commands
Its about a sql topic for basic structured query language
Ad

More from Al-Mamun Sarkar (20)

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

Recently uploaded (20)

PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PPTX
Airline CRS | Airline CRS Systems | CRS System
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PPTX
Matchmaking for JVMs: How to Pick the Perfect GC Partner
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PPTX
most interesting chapter in the world ppt
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PPTX
CNN LeNet5 Architecture: Neural Networks
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PPTX
Lecture 5 Software Requirement Engineering
PDF
Guide to Food Delivery App Development.pdf
PPTX
Introduction to Windows Operating System
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PPTX
Trending Python Topics for Data Visualization in 2025
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
Wondershare Recoverit Full Crack New Version (Latest 2025)
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
Airline CRS | Airline CRS Systems | CRS System
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Matchmaking for JVMs: How to Pick the Perfect GC Partner
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
most interesting chapter in the world ppt
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
CNN LeNet5 Architecture: Neural Networks
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Lecture 5 Software Requirement Engineering
Guide to Food Delivery App Development.pdf
Introduction to Windows Operating System
DNT Brochure 2025 – ISV Solutions @ D365
Trending Python Topics for Data Visualization in 2025
BoxLang Dynamic AWS Lambda - Japan Edition

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;