SlideShare a Scribd company logo
1 of 41
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

Similar to SQL | DML

Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptxSheethal Aji Mani
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxjainendraKUMAR55
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statementsMohd Tousif
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...SakkaravarthiS1
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL Rc Os
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasadpaddu123
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasadpaddu123
 
SQL interview questions by jeetendra mandal - part 3
SQL interview questions by jeetendra mandal - part 3SQL interview questions by jeetendra mandal - part 3
SQL interview questions by jeetendra mandal - part 3jeetendra mandal
 
SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2jeetendra mandal
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfDraguClaudiu
 
about-SQL AND ETC.pptx
about-SQL AND ETC.pptxabout-SQL AND ETC.pptx
about-SQL AND ETC.pptxjwhuqyqtayaw
 
MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.sudhasuryasnata06
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxEliasPetros
 
MySQL notes - Basic Commands and Definitions
MySQL notes - Basic Commands and DefinitionsMySQL notes - Basic Commands and Definitions
MySQL notes - Basic Commands and DefinitionsDeepakDeedarSingla
 

Similar to SQL | DML (20)

Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptx
 
DBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptxDBMS and SQL(structured query language) .pptx
DBMS and SQL(structured query language) .pptx
 
Sql introduction
Sql introductionSql introduction
Sql introduction
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL
 
Introduction to SQL..pdf
Introduction to SQL..pdfIntroduction to SQL..pdf
Introduction to SQL..pdf
 
2..basic queries.pptx
2..basic queries.pptx2..basic queries.pptx
2..basic queries.pptx
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
SQL interview questions by jeetendra mandal - part 3
SQL interview questions by jeetendra mandal - part 3SQL interview questions by jeetendra mandal - part 3
SQL interview questions by jeetendra mandal - part 3
 
SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2
 
Sql commands
Sql commandsSql commands
Sql commands
 
Lab2 ddl commands
Lab2 ddl commandsLab2 ddl commands
Lab2 ddl commands
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
 
about-SQL AND ETC.pptx
about-SQL AND ETC.pptxabout-SQL AND ETC.pptx
about-SQL AND ETC.pptx
 
MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 
MySQL notes - Basic Commands and Definitions
MySQL notes - Basic Commands and DefinitionsMySQL notes - Basic Commands and Definitions
MySQL notes - Basic Commands and Definitions
 

More from To Sum It Up

Prompt Engineering | Beginner's Guide - For You
Prompt Engineering | Beginner's Guide - For YouPrompt Engineering | Beginner's Guide - For You
Prompt Engineering | Beginner's Guide - For YouTo Sum It Up
 
Natural Language Processing (NLP) | Basics
Natural Language Processing (NLP) | BasicsNatural Language Processing (NLP) | Basics
Natural Language Processing (NLP) | BasicsTo Sum It Up
 
It's Machine Learning Basics -- For You!
It's Machine Learning Basics -- For You!It's Machine Learning Basics -- For You!
It's Machine Learning Basics -- For You!To Sum It Up
 
Polymorphism in Python
Polymorphism in PythonPolymorphism in Python
Polymorphism in PythonTo Sum It Up
 
Web API - Overview
Web API - OverviewWeb API - Overview
Web API - OverviewTo Sum It Up
 
User story mapping
User story mappingUser story mapping
User story mappingTo Sum It Up
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialTo Sum It Up
 
Problem solving using computers - Chapter 1
Problem solving using computers - Chapter 1 Problem solving using computers - Chapter 1
Problem solving using computers - Chapter 1 To Sum It Up
 
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdf
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdfQuality Circle | Case Study on Self Esteem | Team Opus Geeks.pdf
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdfTo Sum It Up
 
Multimedia Content and Content Acquisition
Multimedia Content and Content AcquisitionMultimedia Content and Content Acquisition
Multimedia Content and Content AcquisitionTo Sum It Up
 
PHP Arrays_Introduction
PHP Arrays_IntroductionPHP Arrays_Introduction
PHP Arrays_IntroductionTo Sum It Up
 
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - IntroductionTo Sum It Up
 
Programming The Basic Computer
Programming The Basic ComputerProgramming The Basic Computer
Programming The Basic ComputerTo Sum It Up
 
Ozone in wastewater treatment
Ozone in wastewater treatmentOzone in wastewater treatment
Ozone in wastewater treatmentTo Sum It Up
 

More from To Sum It Up (20)

Prompt Engineering | Beginner's Guide - For You
Prompt Engineering | Beginner's Guide - For YouPrompt Engineering | Beginner's Guide - For You
Prompt Engineering | Beginner's Guide - For You
 
Natural Language Processing (NLP) | Basics
Natural Language Processing (NLP) | BasicsNatural Language Processing (NLP) | Basics
Natural Language Processing (NLP) | Basics
 
It's Machine Learning Basics -- For You!
It's Machine Learning Basics -- For You!It's Machine Learning Basics -- For You!
It's Machine Learning Basics -- For You!
 
Polymorphism in Python
Polymorphism in PythonPolymorphism in Python
Polymorphism in Python
 
DSA Question Bank
DSA Question BankDSA Question Bank
DSA Question Bank
 
Web API - Overview
Web API - OverviewWeb API - Overview
Web API - Overview
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
HTML Overview
HTML OverviewHTML Overview
HTML Overview
 
EM Algorithm
EM AlgorithmEM Algorithm
EM Algorithm
 
User story mapping
User story mappingUser story mapping
User story mapping
 
User stories
User storiesUser stories
User stories
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
 
Problem solving using computers - Chapter 1
Problem solving using computers - Chapter 1 Problem solving using computers - Chapter 1
Problem solving using computers - Chapter 1
 
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdf
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdfQuality Circle | Case Study on Self Esteem | Team Opus Geeks.pdf
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdf
 
Multimedia Content and Content Acquisition
Multimedia Content and Content AcquisitionMultimedia Content and Content Acquisition
Multimedia Content and Content Acquisition
 
PHP Arrays_Introduction
PHP Arrays_IntroductionPHP Arrays_Introduction
PHP Arrays_Introduction
 
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
 
Leadership
LeadershipLeadership
Leadership
 
Programming The Basic Computer
Programming The Basic ComputerProgramming The Basic Computer
Programming The Basic Computer
 
Ozone in wastewater treatment
Ozone in wastewater treatmentOzone in wastewater treatment
Ozone in wastewater treatment
 

Recently uploaded

Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 

Recently uploaded (20)

Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 

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