SlideShare a Scribd company logo
SQL Online
Training
Organized collection of structured
information, or data, typically stored
electronically
Database
Uses of Database
• Databases can store very large
numbers of records efficiently (they
take up little space).
• It is very quick and easy to find
information.
• It is easy to add new data and to edit
or delete old data.
• Data sharing. Fast and efficient
collaboration between users.
• Data access and auditing. Controlled
access to databases.
What's SQL?
Structured Query Language
SQL (Structured Query Language) is a standardized programming language
that's used to manage relational databases and perform various operations
on the data in them.
SQL is not a database system, but it is a query
language.
What's is relational
database?
RDBMS
Relational Database Management System
An RDBMS is a type of database management system (DBMS)
that stores data in a row-based table structure which
connects related data elements.
Why RDBMS?
An RDBMS includes functions that maintain the security,
accuracy, integrity and consistency of the data.
Examples
Examples of the most popular RDBMS are MYSQL, Oracle,
IBM DB2, and Microsoft SQL Server database.
Basic concepts of SQL
SQL CREATE DATABASE
The CREATE DATABASE statement is used to create a new SQL
database.
CREATE DATABASE
databasename;
SQL CREATE TABLE
The CREATE TABLE statement is used to create a new table in a
database.
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
The column parameters specify the names of the
columns of the table. The datatype parameter
specifies the type of data the column can hold
(e.g. varchar, integer, date, etc.).
SQL INSERT INTO
The INSERT INTO statement is used to insert new records in a table.
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
Specify both the column names and the values to
be inserted, when you are targeting only specific
ones.
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
If you are adding values for all the columns of the
table, you do not need to specify the column
names in the SQL query
How to display?
USING SQL SELECT
The SELECT statement is used to select data from a database. The
data returned is stored in a result table, called the result-set.
SELECT column1, column2, ...
FROM table_name;
Specify both the column names, when you are
targeting only specific ones.
SELECT * FROM table_name;
If you want to select all the fields available in the
table, use *
USING SQL SELECT DISTINCT
The SELECT DISTINCT statement is used to return only distinct
(different) values.
SELECT DISTINCT column1, column2, ...
FROM table_name;
Specify column names, when you are targeting
only specific ones.
SELECT DISTINCT * FROM table_name;
If you want to select all the fields available in the
table, use *
USING SQL WHERE
The WHERE clause is used to filter records.
SELECT column1, column2, ...
FROM table_name
WHERE condition;
Specify column names, when you are targeting
only specific ones.
SELECT * FROM table_name WHERE
condition;
If you want to select all the fields available in the
table, use *
SQL UPDATE
The UPDATE statement is used to modify the existing records in a
table.
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
Be careful when updating records in a table! Notice the WHERE clause in the UPDATE
statement. The WHERE clause specifies which record(s) that should be updated. If you omit
the WHERE clause, all records in the table will be updated!
SQL DELETE
The DELETE statement is used to delete existing records in a table.
DELETE FROM table_name WHERE condition;
Be careful when deleting records in a table! Notice the WHERE clause in the DELETE
statement. The WHERE clause specifies which record(s) should be deleted. If you omit the
WHERE clause, all records in the table will be deleted!
How to assign multiple
conditions?
Use operators!!
USING SQL AND operator
The AND operator displays a record if all the conditions separated by
AND are TRUE.
SELECT column1, column2, ...
FROM table_name
WHERE condition1 AND condition2 OR condition3 ...;
The AND operator is used to filter records based on more than one condition
USING SQL OR operator
The OR operator displays a record if any of the conditions separated
by OR is TRUE.
SELECT column1, column2, ...
FROM table_name
WHERE condition1 OR condition2 OR condition3 ...;
The OR operator is used to filter records based on more than one condition
USING SQL NOT operator
The NOT operator displays a record if the condition(s) is NOT TRUE.
SELECT column1, column2, ...
FROM table_name
WHERE NOT condition;
The NOT operator is used to filter records when conditions turns out to be False!
How to delete a table?
SQL DROP TABLE
The DROP TABLE statement is used to drop an existing table in a
database.
DROP TABLE table_name;
Be careful before dropping a table. Deleting a table will result in loss of complete information
stored in the table!
How to delete a
database?
SQL DROP DATABASE
The DROP DATABASE statement is used to drop an existing SQL
database.
DROP DATABASE databasename;
Be careful before dropping a database. Deleting a database will result in loss of complete
information stored in the database!
MySQL
Database
MySQL is a relational database management
system based on SQL – Structured Query
Language.
Quiz session
Full form of SQL
Drop your answers
Full form of SQL
Structured Query Language
Full form of DBMS
Drop your answers
Full form of DBMS
Database Management System
Full form of RDBMS
Drop your answers
Full form of RDBMS
Relational Database Management System
CREATE TABLE StudentData(
regNo int,
StudentName varchar(255)
);
INSERT INTO StudentData VALUES (1234, "Abc");
UPDATE StudentData SET StudentName="Cde" WHERE regNo=1234;
SELECT * FROM StudentData;
What's the output?
CREATE TABLE StudentData(
regNo int,
StudentName varchar(255)
);
INSERT INTO StudentData VALUES (1234, "Abc");
UPDATE StudentData SET StudentName="Cde" WHERE regNo=1234;
SELECT * FROM StudentData;
Abc changes to Cde
Thank you!

More Related Content

PDF
full detailled SQL notesquestion bank (1).pdf
PPTX
SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTER SCIENCE...
PPTX
SQL.pptx SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTE...
PDF
DBMS.pdf
PPTX
SQL DATABASE MANAGAEMENT SYSTEM FOR CLASS 12 CBSE
 
PDF
Class XII-UNIT III - SQL and MySQL Notes_0.pdf
PDF
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
PPTX
4 SQL DML.pptx ASHEN WANNIARACHCHI USESS
full detailled SQL notesquestion bank (1).pdf
SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTER SCIENCE...
SQL.pptx SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTE...
DBMS.pdf
SQL DATABASE MANAGAEMENT SYSTEM FOR CLASS 12 CBSE
 
Class XII-UNIT III - SQL and MySQL Notes_0.pdf
ADBMS unit 1.pdfsdgdsgdsgdsgdsgdsgdsgdsg
4 SQL DML.pptx ASHEN WANNIARACHCHI USESS

Similar to SQL | DML (20)

PDF
SQL for data scientist And data analysist Advanced
PPTX
Database Overview
PPTX
SQL Assessment Command Statements
PDF
Complete SQL Tutorial In Hindi By Rishabh Mishra (Basic to Advance).pdf
PPTX
Lesson-02 (1).pptx
PPTX
PPTX
Sql slid
PPTX
PPTX
SQL.pptx for the begineers and good know
PDF
sql_data.pdf
PPTX
Data Base Management 1 Database Management.pptx
PPTX
SQL PPT.pptx
PPTX
2..basic queries.pptx
PPTX
shs tvl ict_Programming Introduction to SQl.pptx
PPTX
Chapter-9-MySQL.pptxxzrtyryrydfdsfdsfdsrter
PPTX
sql.pptx
PPTX
PDF
Database Management System 1
PPTX
SQL
PPTX
SQL
SQL for data scientist And data analysist Advanced
Database Overview
SQL Assessment Command Statements
Complete SQL Tutorial In Hindi By Rishabh Mishra (Basic to Advance).pdf
Lesson-02 (1).pptx
Sql slid
SQL.pptx for the begineers and good know
sql_data.pdf
Data Base Management 1 Database Management.pptx
SQL PPT.pptx
2..basic queries.pptx
shs tvl ict_Programming Introduction to SQl.pptx
Chapter-9-MySQL.pptxxzrtyryrydfdsfdsfdsrter
sql.pptx
Database Management System 1
SQL
SQL
Ad

More from To Sum It Up (20)

PPTX
Django Framework Interview Guide - Part 1
PPTX
Artificial intelligence ( AI ) | Guide
PPTX
On Page SEO (Search Engine Optimization)
PDF
Prompt Engineering | Beginner's Guide - For You
PPTX
Natural Language Processing (NLP) | Basics
PPTX
It's Machine Learning Basics -- For You!
PPTX
Polymorphism in Python
PDF
DSA Question Bank
PDF
Web API - Overview
PDF
CSS Overview
PDF
HTML Overview
PDF
EM Algorithm
PDF
User story mapping
PDF
User stories
PDF
Problem solving using computers - Unit 1 - Study material
PDF
Problem solving using computers - Chapter 1
PDF
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdf
PPTX
Multimedia Content and Content Acquisition
PPTX
PHP Arrays_Introduction
PDF
System Calls - Introduction
Django Framework Interview Guide - Part 1
Artificial intelligence ( AI ) | Guide
On Page SEO (Search Engine Optimization)
Prompt Engineering | Beginner's Guide - For You
Natural Language Processing (NLP) | Basics
It's Machine Learning Basics -- For You!
Polymorphism in Python
DSA Question Bank
Web API - Overview
CSS Overview
HTML Overview
EM Algorithm
User story mapping
User stories
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Chapter 1
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdf
Multimedia Content and Content Acquisition
PHP Arrays_Introduction
System Calls - Introduction
Ad

Recently uploaded (20)

PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Introduction to Artificial Intelligence
PDF
top salesforce developer skills in 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Nekopoi APK 2025 free lastest update
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
history of c programming in notes for students .pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
System and Network Administraation Chapter 3
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
System and Network Administration Chapter 2
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Introduction to Artificial Intelligence
top salesforce developer skills in 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Nekopoi APK 2025 free lastest update
Design an Analysis of Algorithms I-SECS-1021-03
history of c programming in notes for students .pptx
L1 - Introduction to python Backend.pptx
System and Network Administraation Chapter 3
How to Migrate SBCGlobal Email to Yahoo Easily
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Understanding Forklifts - TECH EHS Solution
Odoo Companies in India – Driving Business Transformation.pdf
How Creative Agencies Leverage Project Management Software.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
System and Network Administration Chapter 2
wealthsignaloriginal-com-DS-text-... (1).pdf

SQL | DML

  • 2. Organized collection of structured information, or data, typically stored electronically Database
  • 4. • Databases can store very large numbers of records efficiently (they take up little space). • It is very quick and easy to find information. • It is easy to add new data and to edit or delete old data. • Data sharing. Fast and efficient collaboration between users. • Data access and auditing. Controlled access to databases.
  • 7. SQL (Structured Query Language) is a standardized programming language that's used to manage relational databases and perform various operations on the data in them.
  • 8. SQL is not a database system, but it is a query language.
  • 10. RDBMS Relational Database Management System An RDBMS is a type of database management system (DBMS) that stores data in a row-based table structure which connects related data elements. Why RDBMS? An RDBMS includes functions that maintain the security, accuracy, integrity and consistency of the data. Examples Examples of the most popular RDBMS are MYSQL, Oracle, IBM DB2, and Microsoft SQL Server database.
  • 12. SQL CREATE DATABASE The CREATE DATABASE statement is used to create a new SQL database. CREATE DATABASE databasename;
  • 13. SQL CREATE TABLE The CREATE TABLE statement is used to create a new table in a database. CREATE TABLE table_name ( column1 datatype, column2 datatype, column3 datatype, .... ); The column parameters specify the names of the columns of the table. The datatype parameter specifies the type of data the column can hold (e.g. varchar, integer, date, etc.).
  • 14. SQL INSERT INTO The INSERT INTO statement is used to insert new records in a table. INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...); Specify both the column names and the values to be inserted, when you are targeting only specific ones. INSERT INTO table_name VALUES (value1, value2, value3, ...); If you are adding values for all the columns of the table, you do not need to specify the column names in the SQL query
  • 16. USING SQL SELECT The SELECT statement is used to select data from a database. The data returned is stored in a result table, called the result-set. SELECT column1, column2, ... FROM table_name; Specify both the column names, when you are targeting only specific ones. SELECT * FROM table_name; If you want to select all the fields available in the table, use *
  • 17. USING SQL SELECT DISTINCT The SELECT DISTINCT statement is used to return only distinct (different) values. SELECT DISTINCT column1, column2, ... FROM table_name; Specify column names, when you are targeting only specific ones. SELECT DISTINCT * FROM table_name; If you want to select all the fields available in the table, use *
  • 18. USING SQL WHERE The WHERE clause is used to filter records. SELECT column1, column2, ... FROM table_name WHERE condition; Specify column names, when you are targeting only specific ones. SELECT * FROM table_name WHERE condition; If you want to select all the fields available in the table, use *
  • 19. SQL UPDATE The UPDATE statement is used to modify the existing records in a table. UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition; Be careful when updating records in a table! Notice the WHERE clause in the UPDATE statement. The WHERE clause specifies which record(s) that should be updated. If you omit the WHERE clause, all records in the table will be updated!
  • 20. SQL DELETE The DELETE statement is used to delete existing records in a table. DELETE FROM table_name WHERE condition; Be careful when deleting records in a table! Notice the WHERE clause in the DELETE statement. The WHERE clause specifies which record(s) should be deleted. If you omit the WHERE clause, all records in the table will be deleted!
  • 21. How to assign multiple conditions?
  • 23. USING SQL AND operator The AND operator displays a record if all the conditions separated by AND are TRUE. SELECT column1, column2, ... FROM table_name WHERE condition1 AND condition2 OR condition3 ...; The AND operator is used to filter records based on more than one condition
  • 24. USING SQL OR operator The OR operator displays a record if any of the conditions separated by OR is TRUE. SELECT column1, column2, ... FROM table_name WHERE condition1 OR condition2 OR condition3 ...; The OR operator is used to filter records based on more than one condition
  • 25. USING SQL NOT operator The NOT operator displays a record if the condition(s) is NOT TRUE. SELECT column1, column2, ... FROM table_name WHERE NOT condition; The NOT operator is used to filter records when conditions turns out to be False!
  • 26. How to delete a table?
  • 27. SQL DROP TABLE The DROP TABLE statement is used to drop an existing table in a database. DROP TABLE table_name; Be careful before dropping a table. Deleting a table will result in loss of complete information stored in the table!
  • 28. How to delete a database?
  • 29. SQL DROP DATABASE The DROP DATABASE statement is used to drop an existing SQL database. DROP DATABASE databasename; Be careful before dropping a database. Deleting a database will result in loss of complete information stored in the database!
  • 31. MySQL is a relational database management system based on SQL – Structured Query Language.
  • 33. Full form of SQL Drop your answers
  • 34. Full form of SQL Structured Query Language
  • 35. Full form of DBMS Drop your answers
  • 36. Full form of DBMS Database Management System
  • 37. Full form of RDBMS Drop your answers
  • 38. Full form of RDBMS Relational Database Management System
  • 39. CREATE TABLE StudentData( regNo int, StudentName varchar(255) ); INSERT INTO StudentData VALUES (1234, "Abc"); UPDATE StudentData SET StudentName="Cde" WHERE regNo=1234; SELECT * FROM StudentData; What's the output?
  • 40. CREATE TABLE StudentData( regNo int, StudentName varchar(255) ); INSERT INTO StudentData VALUES (1234, "Abc"); UPDATE StudentData SET StudentName="Cde" WHERE regNo=1234; SELECT * FROM StudentData; Abc changes to Cde