SlideShare a Scribd company logo
Statements,joins and operators in sql by thanveer danish melayi(1)
sql statements,operators and 
joins 
typing speed:25 
Muhammed Thanveer Melayi 
Muhammedthanveermelayi@outlook.com 
Muhammed Thanveer Danish Melayi 
Muhammed Thanveer M
• different type of statements 
1.DML 
2.DDL 
3.DCL
DML 
DML is abbreviation of Data Manipulation 
Language. It is used to retrieve, store, modify, 
delete, insert and update data in database. 
Examples: SELECT, UPDATE, INSERT 
statements
SYNTAX OF INSERT INTO 
INSERT INTO table_name (column1,column2,column3,...) 
VALUES (value1,value2,value3,...); 
INSERT INTO Customers (CustomerName, ContactName, Address, City, 
PostalCode, Country) 
VALUES ('Cardinal','Tom B. Erichsen','Skagen 
21','Stavanger','4006','Norway');
DDL 
DDL is abbreviation of Data Definition Language. It is used 
to create and modify the structure of database objects in 
database. 
Examples: CREATE, ALTER, DROP statements
SYNTAX OF CREATE 
CREATE TABLE table_name 
( 
column_name1 data_type(size), 
column_name2 data_type(size), 
column_name3 data_type(size), 
.... 
); 
CREATE TABLE Persons 
( 
PersonID int, 
LastName varchar(255), 
FirstName varchar(255), 
Address varchar(255), 
City varchar(255) 
);
DCL 
DCL is abbreviation of Data Control Language. It is used 
to create roles, permissions, and referential integrity as 
well it is used to control access to database by securing 
it. 
Examples: GRANT, REVOKE statements 
• GRANT - gives user's access privileges to database 
• REVOKE - withdraw access privileges given with the GRANT command
GRANT 
privilege_name 
ON object_name 
TO {user_name 
|PUBLIC 
• privilege_name is the access right or privilege granted to the user. 
Some of the access rights are ALL, EXECUTE, and SELECT. 
• object_name is the name of an database object like TABLE, VIEW, 
STORED PROC and SEQUENCE. 
• user_name is the name of the user to whom an access right is 
being granted. 
• PUBLIC is used to grant access rights to all users. 
• ROLES are a set of privileges grouped together. 
• WITH GRANT OPTION - allows a user to grant access rights to other 
users. 
|role_name} 
[WITH GRANT 
OPTION];
SYNTAX OF REVOKE 
REVOKE 
privilege_name 
ON object_name 
FROM {user_name 
|PUBLIC 
|role_name}
example for grant 
grant select --granting select privilege 
on emp 
to public --you can give username at the place of public 
example for revoke 
revoke select--removing select privilege 
on emp 
from public
Joins 
SQL JOIN clause is used to combine rows from two or more 
tables, based on a common field between them. 
1.inner join 
2.full join 
3.left join 
4.right join
SQL INNER JOIN Keyword 
The INNER JOIN keyword selects all rows from both tables as long as there 
is a match between the columns in both tables. 
SQL INNER JOIN Syntax 
SELECT column_name(s) 
FROM table1 
INNER JOIN table2 
ON table1.column_name=table2.column_name;
SQL FULL OUTER JOIN Keyword 
The FULL OUTER JOIN keyword returns all rows from the left table 
(table1) and from the right table (table2). 
The FULL OUTER JOIN keyword combines the result of both LEFT and 
RIGHT joins. 
SQL FULL OUTER JOIN Syntax 
SELECT column_name(s) 
FROM table1 
FULL OUTER JOIN table2 
ON table1.column_name=table2.column_name;
SQL LEFT JOIN Keyword 
The LEFT JOIN keyword returns all rows from the left table 
(table1), with the matching rows in the right table (table2). The 
result is NULL in the right side when there is no match. 
SQL LEFT JOIN Syntax 
SELECT column_name(s) 
FROM table1 
LEFT JOIN table2 
ON table1.column_name=table2.column_name;
SQL RIGHT JOIN Keyword 
The RIGHT JOIN keyword returns all rows from the right table 
(table2), with the matching rows in the left table (table1). The result 
is NULL in the left side when there is no match. 
SQL RIGHT JOIN Syntax 
SELECT column_name(s) 
FROM table1 
RIGHT JOIN table2 
ON table1.column_name=table2.column_name;
Operators 
What is an Operator in SQL? 
An operator is a reserved word or a character used primarily in an SQL 
statement's WHERE clause to perform operation(s), such as 
comparisons and arithmetic operations. 
Operators are used to specify conditions in an SQL 
statement and to serve as conjunctions for multiple 
conditions in a statement. 
• Arithmetic operators (+,*,/,-...) 
• Comparison operators (=,!=,<>,>,<,>=.......) 
• Logical operators
example for logical operators 
ALL 
The ALL operator is used to compare a value to all values in another value set. 
AND 
The AND operator allows the existence of multiple conditions in an SQL statement's WHERE clause. 
ANY 
The ANY operator is used to compare a value to any applicable value in the list according to the 
condition. 
BETWEEN 
The BETWEEN operator is used to search for values that are within a set of values, given the minimum 
value and the maximum value. 
OR 
The OR operator is used to combine multiple conditions in an SQL statement's WHERE clause. 
IS NULL 
The NULL operator is used to compare a value with a NULL value. 
UNIQUE 
The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates). 
for example.... 
SELECT * FROM Products 
WHERE Price BETWEEN 10 AND 20;
THANK 
YOU
Disclaimer: This presentation is prepared by trainees of 
baabtra.com as a part of mentoring program. This is not 
official document of baabtra.com – Mentoring Partner
Want to learn more about programming or Looking to become a good programmer? 
Are you wasting time on searching so many contents online? 
Do you want to learn things quickly? 
Tired of spending huge amount of money to become a Software professional? 
Do an online course 
@ baabtra.com 
We put industry standards to practice. Our structured, activity based courses are so designed 
to make a quick, good software professional out of anybody who holds a passion for coding.
Follow us @ twitter.com/baabtra 
Like us @ facebook.com/baabtra 
Subscribe to us @ youtube.com/baabtra 
Become a follower @ slideshare.net/BaabtraMentoringPartner 
Connect to us @ in.linkedin.com/in/baabtra 
Give a feedback @ massbaab.com/baabtra 
Thanks in advance 
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us 
Emarald Mall (Big Bazar Building) 
Mavoor Road, Kozhikode, 
Kerala, India. 
Ph: + 91 – 495 40 25 550 
NC Complex, Near Bus Stand 
Mukkam, Kozhikode, 
Kerala, India. 
Ph: + 91 – 495 40 25 550 
Cafit Square, 
Hilite Business Park, 
Near Pantheerankavu, 
Kozhikode 
Start up Village 
Eranakulam, 
Kerala, India. 
Email: info@baabtra.com

More Related Content

PPTX
STRUCTURE OF SQL QUERIES
PPTX
Data Manipulation Language
PPTX
SQL Queries Information
PPTX
Referential integrity
PPT
SQL Queries
PDF
Integrity constraints in dbms
PPTX
Database Design and Normalization Techniques
PPTX
SQL Basics
STRUCTURE OF SQL QUERIES
Data Manipulation Language
SQL Queries Information
Referential integrity
SQL Queries
Integrity constraints in dbms
Database Design and Normalization Techniques
SQL Basics

What's hot (18)

PPTX
Sql basics
PPTX
Sql(structured query language)
PPT
Sql select
PPTX
Integrity Constraints
PDF
Sql integrity constraints
PDF
PostgreSQL Tutorial for Beginners | Edureka
PPT
Introduction to-sql
PPTX
Database normalization
PPTX
SQL : Structured Query Language
PPTX
Basic SQL Statments
PPTX
Dbms relational data model and sql queries
PDF
SQL Overview
PDF
Sql ch 9 - data integrity
PDF
Chapter 2 Relational Data Model-part1
PPTX
introdution to SQL and SQL functions
PPTX
Introduction to SQL
DOC
Database queries
Sql basics
Sql(structured query language)
Sql select
Integrity Constraints
Sql integrity constraints
PostgreSQL Tutorial for Beginners | Edureka
Introduction to-sql
Database normalization
SQL : Structured Query Language
Basic SQL Statments
Dbms relational data model and sql queries
SQL Overview
Sql ch 9 - data integrity
Chapter 2 Relational Data Model-part1
introdution to SQL and SQL functions
Introduction to SQL
Database queries
Ad

Similar to Statements,joins and operators in sql by thanveer danish melayi(1) (20)

PPT
Mysql
PPT
Sql 2006
PDF
SQL & Adv SQL - Basics and Advanced for Beginners
PPTX
ADVANCE ITT BY PRASAD
PPTX
Structure Query Language (SQL).pptx
PPTX
Structure query language (sql)
PPTX
Data Manipulation Language.pptx
PDF
sql notes Provideby AGN HUB Tech & It Solutions
PPTX
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
PDF
PPT
Advanced Sql Training
PDF
Database management system unit 1 Bca 2-semester notes
PDF
Structure query language, database course
PPTX
SQL Server Learning Drive
PDF
1.Types of SQL Commands for mba students
DOC
Adbms
PDF
Database Architecture and Basic Concepts
PPTX
Lab1 select statement
PDF
chapter-14-sql-commands.pdf
PPTX
SQL OVERVIEW for a new introduced student.pptx
Mysql
Sql 2006
SQL & Adv SQL - Basics and Advanced for Beginners
ADVANCE ITT BY PRASAD
Structure Query Language (SQL).pptx
Structure query language (sql)
Data Manipulation Language.pptx
sql notes Provideby AGN HUB Tech & It Solutions
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
Advanced Sql Training
Database management system unit 1 Bca 2-semester notes
Structure query language, database course
SQL Server Learning Drive
1.Types of SQL Commands for mba students
Adbms
Database Architecture and Basic Concepts
Lab1 select statement
chapter-14-sql-commands.pdf
SQL OVERVIEW for a new introduced student.pptx
Ad

More from Muhammed Thanveer M (20)

DOCX
Easy check is simple and easy use lodge management system
DOCX
KEYBAN...MODULES
PPTX
KeyBan....easy to think and work
PPTX
DOCX
mysql ....question and answer by muhammed thanveer melayi
PPTX
Transation.....thanveeer
PPTX
Stored procedures by thanveer danish melayi
PPTX
Udf&views in sql...by thanveer melayi
PPTX
Aptitude Questions-2
DOCX
The basics of c programming
PPTX
Preprocesser in c
PPTX
Functions with heap and stack....by thanveer danish
PPTX
Elements of c program....by thanveer danish
PPTX
Aptitude model by thanveer danish
PPTX
Preprocesser in c++ by thanveer danish
PPTX
Data base by thanveer danish
PPTX
Oop concept in c++ by MUhammed Thanveer Melayi
PPTX
Memory allocation in c
DOCX
Understanding c file handling functions with examples
Easy check is simple and easy use lodge management system
KEYBAN...MODULES
KeyBan....easy to think and work
mysql ....question and answer by muhammed thanveer melayi
Transation.....thanveeer
Stored procedures by thanveer danish melayi
Udf&views in sql...by thanveer melayi
Aptitude Questions-2
The basics of c programming
Preprocesser in c
Functions with heap and stack....by thanveer danish
Elements of c program....by thanveer danish
Aptitude model by thanveer danish
Preprocesser in c++ by thanveer danish
Data base by thanveer danish
Oop concept in c++ by MUhammed Thanveer Melayi
Memory allocation in c
Understanding c file handling functions with examples

Recently uploaded (20)

PPTX
Transform Your Business with a Software ERP System
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Nekopoi APK 2025 free lastest update
PDF
top salesforce developer skills in 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Essential Infomation Tech presentation.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Digital Strategies for Manufacturing Companies
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
System and Network Administration Chapter 2
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Transform Your Business with a Software ERP System
VVF-Customer-Presentation2025-Ver1.9.pptx
Nekopoi APK 2025 free lastest update
top salesforce developer skills in 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Essential Infomation Tech presentation.pptx
How to Choose the Right IT Partner for Your Business in Malaysia
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Operating system designcfffgfgggggggvggggggggg
Digital Strategies for Manufacturing Companies
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Migrate SBCGlobal Email to Yahoo Easily
Internet Downloader Manager (IDM) Crack 6.42 Build 41
How Creative Agencies Leverage Project Management Software.pdf
CHAPTER 2 - PM Management and IT Context
System and Network Administration Chapter 2
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

Statements,joins and operators in sql by thanveer danish melayi(1)

  • 2. sql statements,operators and joins typing speed:25 Muhammed Thanveer Melayi Muhammedthanveermelayi@outlook.com Muhammed Thanveer Danish Melayi Muhammed Thanveer M
  • 3. • different type of statements 1.DML 2.DDL 3.DCL
  • 4. DML DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database. Examples: SELECT, UPDATE, INSERT statements
  • 5. SYNTAX OF INSERT INTO INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...); INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country) VALUES ('Cardinal','Tom B. Erichsen','Skagen 21','Stavanger','4006','Norway');
  • 6. DDL DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database. Examples: CREATE, ALTER, DROP statements
  • 7. SYNTAX OF CREATE CREATE TABLE table_name ( column_name1 data_type(size), column_name2 data_type(size), column_name3 data_type(size), .... ); CREATE TABLE Persons ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) );
  • 8. DCL DCL is abbreviation of Data Control Language. It is used to create roles, permissions, and referential integrity as well it is used to control access to database by securing it. Examples: GRANT, REVOKE statements • GRANT - gives user's access privileges to database • REVOKE - withdraw access privileges given with the GRANT command
  • 9. GRANT privilege_name ON object_name TO {user_name |PUBLIC • privilege_name is the access right or privilege granted to the user. Some of the access rights are ALL, EXECUTE, and SELECT. • object_name is the name of an database object like TABLE, VIEW, STORED PROC and SEQUENCE. • user_name is the name of the user to whom an access right is being granted. • PUBLIC is used to grant access rights to all users. • ROLES are a set of privileges grouped together. • WITH GRANT OPTION - allows a user to grant access rights to other users. |role_name} [WITH GRANT OPTION];
  • 10. SYNTAX OF REVOKE REVOKE privilege_name ON object_name FROM {user_name |PUBLIC |role_name}
  • 11. example for grant grant select --granting select privilege on emp to public --you can give username at the place of public example for revoke revoke select--removing select privilege on emp from public
  • 12. Joins SQL JOIN clause is used to combine rows from two or more tables, based on a common field between them. 1.inner join 2.full join 3.left join 4.right join
  • 13. SQL INNER JOIN Keyword The INNER JOIN keyword selects all rows from both tables as long as there is a match between the columns in both tables. SQL INNER JOIN Syntax SELECT column_name(s) FROM table1 INNER JOIN table2 ON table1.column_name=table2.column_name;
  • 14. SQL FULL OUTER JOIN Keyword The FULL OUTER JOIN keyword returns all rows from the left table (table1) and from the right table (table2). The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins. SQL FULL OUTER JOIN Syntax SELECT column_name(s) FROM table1 FULL OUTER JOIN table2 ON table1.column_name=table2.column_name;
  • 15. SQL LEFT JOIN Keyword The LEFT JOIN keyword returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side when there is no match. SQL LEFT JOIN Syntax SELECT column_name(s) FROM table1 LEFT JOIN table2 ON table1.column_name=table2.column_name;
  • 16. SQL RIGHT JOIN Keyword The RIGHT JOIN keyword returns all rows from the right table (table2), with the matching rows in the left table (table1). The result is NULL in the left side when there is no match. SQL RIGHT JOIN Syntax SELECT column_name(s) FROM table1 RIGHT JOIN table2 ON table1.column_name=table2.column_name;
  • 17. Operators What is an Operator in SQL? An operator is a reserved word or a character used primarily in an SQL statement's WHERE clause to perform operation(s), such as comparisons and arithmetic operations. Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement. • Arithmetic operators (+,*,/,-...) • Comparison operators (=,!=,<>,>,<,>=.......) • Logical operators
  • 18. example for logical operators ALL The ALL operator is used to compare a value to all values in another value set. AND The AND operator allows the existence of multiple conditions in an SQL statement's WHERE clause. ANY The ANY operator is used to compare a value to any applicable value in the list according to the condition. BETWEEN The BETWEEN operator is used to search for values that are within a set of values, given the minimum value and the maximum value. OR The OR operator is used to combine multiple conditions in an SQL statement's WHERE clause. IS NULL The NULL operator is used to compare a value with a NULL value. UNIQUE The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates). for example.... SELECT * FROM Products WHERE Price BETWEEN 10 AND 20;
  • 20. Disclaimer: This presentation is prepared by trainees of baabtra.com as a part of mentoring program. This is not official document of baabtra.com – Mentoring Partner
  • 21. Want to learn more about programming or Looking to become a good programmer? Are you wasting time on searching so many contents online? Do you want to learn things quickly? Tired of spending huge amount of money to become a Software professional? Do an online course @ baabtra.com We put industry standards to practice. Our structured, activity based courses are so designed to make a quick, good software professional out of anybody who holds a passion for coding.
  • 22. Follow us @ twitter.com/baabtra Like us @ facebook.com/baabtra Subscribe to us @ youtube.com/baabtra Become a follower @ slideshare.net/BaabtraMentoringPartner Connect to us @ in.linkedin.com/in/baabtra Give a feedback @ massbaab.com/baabtra Thanks in advance www.baabtra.com | www.massbaab.com |www.baabte.com
  • 23. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Cafit Square, Hilite Business Park, Near Pantheerankavu, Kozhikode Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com