SlideShare a Scribd company logo
1 of 9
BETWEEN : it is used to select values within a
range.
SELECT column_name FROM table_name
WHERE column_name BETWEEN value1 AND val
ue2;
SELECT column_name FROM table_name
WHERE column_name NOT
BETWEEN value1 AND value2;
IN :
select column_name from table_name
where column_name in (value1,value2,...);
Example:
Select * from table_name where address in
(‘delhi’ , ‘mumbai’);
Like
It is used only with char and varchar to match a
pattern.
Both % and _ are used with the like operator to
specify a pattern
Select column_name from table_name where
column_name like ‘a%’;
Select column_name from table_name where
column_name like ‘%d’;
Show who have exactly 5 characters
select column_name from table_name where
colun_name like ‘_____’ ; --5 underscores
Show all the column value whoes 2nd character
is ‘d’
Select colun_name from table_name where
column_name like ‘_d%’;
Select colum_name from table_name where
column_name like ‘%a%a%’;
Count (): counts all the rows
SELECT count(*) FROM table_name;
Sum(): it reurns sum of values from the selected list
of column
select sum(column_name) from table_name;
Max(): it returns the maximum value of the
selected list of item
select max(column_name) from table_name;
Min(): it returns the minimum value of the selected
list of item
select min(column_name) from table_name;
Avg(): it returns the average of column valuess
select avg(column_name) from table_name;
lcase() :
Select lcase(column_name) from table_name;
ucase():
Select ucase(column_name) from table_name;
Now(): show current date and time
select now();
Output:
2014-02-20 22:20:08
SELECT date_format( now(), '%W, %D, %M,
%Y,%T')
w – day
D – date
M – month
Y- year
T – time
Output:
Thursday, 20th, February, 2014,22:18:19
GROUP BY
It is used to group the data. In other word it
divide rows in a table in smaller group.
select dept_no,sum(sal) from employee group
by dept_no;
Here,
Employee - table_name
Dept_no and sal - column_name
HAVING
It is used to applied condition on aggregate
functions with group by.
Example:
select dept_no,max(sal) from employee group
by dept_no having sum(sal)>100;

More Related Content

What's hot

VLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHVLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHMridul Bansal
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Achmad Solichin
 
Where conditions and Operators in SQL
Where conditions and Operators in SQLWhere conditions and Operators in SQL
Where conditions and Operators in SQLRaajendra M
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraintsVivek Singh
 
Fundamentals of C Programming Language
Fundamentals of C Programming LanguageFundamentals of C Programming Language
Fundamentals of C Programming LanguageRamaBoya2
 
How to use Hlookup find an exact match
How to use Hlookup find an exact match How to use Hlookup find an exact match
How to use Hlookup find an exact match Excel Advise
 
SQL Functions - Oracle SQL Fundamentals
SQL Functions - Oracle SQL FundamentalsSQL Functions - Oracle SQL Fundamentals
SQL Functions - Oracle SQL FundamentalsMuhammadWaheed44
 
How to use vlookup in MS Excel
How to use vlookup in MS ExcelHow to use vlookup in MS Excel
How to use vlookup in MS ExcelJaspal Singh
 
03 ohp slides 1
03 ohp slides 103 ohp slides 1
03 ohp slides 1Anne Lee
 
Intro to tsql unit 11
Intro to tsql   unit 11Intro to tsql   unit 11
Intro to tsql unit 11Syed Asrarali
 

What's hot (19)

Les18
Les18Les18
Les18
 
Les17
Les17Les17
Les17
 
enums
enumsenums
enums
 
VLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHVLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCH
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
Where conditions and Operators in SQL
Where conditions and Operators in SQLWhere conditions and Operators in SQL
Where conditions and Operators in SQL
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraints
 
Chapter9 more on database and sql
Chapter9 more on database and sqlChapter9 more on database and sql
Chapter9 more on database and sql
 
Commands
CommandsCommands
Commands
 
Fundamentals of C Programming Language
Fundamentals of C Programming LanguageFundamentals of C Programming Language
Fundamentals of C Programming Language
 
Array
ArrayArray
Array
 
R - mean, median and mode
R - mean, median and modeR - mean, median and mode
R - mean, median and mode
 
How to use Hlookup find an exact match
How to use Hlookup find an exact match How to use Hlookup find an exact match
How to use Hlookup find an exact match
 
SQL Functions - Oracle SQL Fundamentals
SQL Functions - Oracle SQL FundamentalsSQL Functions - Oracle SQL Fundamentals
SQL Functions - Oracle SQL Fundamentals
 
How to use vlookup in MS Excel
How to use vlookup in MS ExcelHow to use vlookup in MS Excel
How to use vlookup in MS Excel
 
Les04
Les04Les04
Les04
 
03 ohp slides 1
03 ohp slides 103 ohp slides 1
03 ohp slides 1
 
Intro to tsql unit 11
Intro to tsql   unit 11Intro to tsql   unit 11
Intro to tsql unit 11
 

Viewers also liked

bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepausebccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepauseICS User Group
 
bccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 com02 level-up_building_next_generation_business_applicationsbccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 com02 level-up_building_next_generation_business_applicationsICS User Group
 
bccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&outbccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&outICS User Group
 
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
bccon-2014 key01 ibm_collaboration_solutions_connect_2014bccon-2014 key01 ibm_collaboration_solutions_connect_2014
bccon-2014 key01 ibm_collaboration_solutions_connect_2014ICS User Group
 

Viewers also liked (7)

bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepausebccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
 
Loop
LoopLoop
Loop
 
Slide Show
Slide ShowSlide Show
Slide Show
 
презентация Dancers 2.0
презентация Dancers 2.0презентация Dancers 2.0
презентация Dancers 2.0
 
bccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 com02 level-up_building_next_generation_business_applicationsbccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 com02 level-up_building_next_generation_business_applications
 
bccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&outbccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&out
 
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
bccon-2014 key01 ibm_collaboration_solutions_connect_2014bccon-2014 key01 ibm_collaboration_solutions_connect_2014
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
 

Similar to Mysql

Similar to Mysql (20)

V15 like operator-c
V15 like operator-cV15 like operator-c
V15 like operator-c
 
SQL
SQLSQL
SQL
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
Chinabankppt
ChinabankpptChinabankppt
Chinabankppt
 
Module03
Module03Module03
Module03
 
SQL report
SQL reportSQL report
SQL report
 
ADV Powepoint 3 Lec.pptx
ADV Powepoint 3 Lec.pptxADV Powepoint 3 Lec.pptx
ADV Powepoint 3 Lec.pptx
 
SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
 
Where conditions and Operators in SQL
Where conditions and Operators in SQLWhere conditions and Operators in SQL
Where conditions and Operators in SQL
 
dbms.pdf
dbms.pdfdbms.pdf
dbms.pdf
 
Sql Tags
Sql TagsSql Tags
Sql Tags
 
SQL Tutorial for Beginners
SQL Tutorial for BeginnersSQL Tutorial for Beginners
SQL Tutorial for Beginners
 
MY SQL
MY SQLMY SQL
MY SQL
 
Using basic select statement in oracle database
Using basic select statement in oracle databaseUsing basic select statement in oracle database
Using basic select statement in oracle database
 
Sql2
Sql2Sql2
Sql2
 
23. SQL and Database.pdf
23. SQL and Database.pdf23. SQL and Database.pdf
23. SQL and Database.pdf
 
Database Management System 1
Database Management System 1Database Management System 1
Database Management System 1
 
23. SQL and Database.pdf
23. SQL and Database.pdf23. SQL and Database.pdf
23. SQL and Database.pdf
 
Database Systems - SQL - DDL Statements (Chapter 3/3)
Database Systems - SQL - DDL Statements (Chapter 3/3)Database Systems - SQL - DDL Statements (Chapter 3/3)
Database Systems - SQL - DDL Statements (Chapter 3/3)
 

Recently uploaded

Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfUK Journal
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 

Recently uploaded (20)

Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 

Mysql

  • 1. BETWEEN : it is used to select values within a range. SELECT column_name FROM table_name WHERE column_name BETWEEN value1 AND val ue2; SELECT column_name FROM table_name WHERE column_name NOT BETWEEN value1 AND value2;
  • 2. IN : select column_name from table_name where column_name in (value1,value2,...); Example: Select * from table_name where address in (‘delhi’ , ‘mumbai’);
  • 3. Like It is used only with char and varchar to match a pattern. Both % and _ are used with the like operator to specify a pattern Select column_name from table_name where column_name like ‘a%’; Select column_name from table_name where column_name like ‘%d’;
  • 4. Show who have exactly 5 characters select column_name from table_name where colun_name like ‘_____’ ; --5 underscores Show all the column value whoes 2nd character is ‘d’ Select colun_name from table_name where column_name like ‘_d%’; Select colum_name from table_name where column_name like ‘%a%a%’;
  • 5. Count (): counts all the rows SELECT count(*) FROM table_name; Sum(): it reurns sum of values from the selected list of column select sum(column_name) from table_name; Max(): it returns the maximum value of the selected list of item select max(column_name) from table_name; Min(): it returns the minimum value of the selected list of item select min(column_name) from table_name;
  • 6. Avg(): it returns the average of column valuess select avg(column_name) from table_name; lcase() : Select lcase(column_name) from table_name; ucase(): Select ucase(column_name) from table_name; Now(): show current date and time select now(); Output: 2014-02-20 22:20:08
  • 7. SELECT date_format( now(), '%W, %D, %M, %Y,%T') w – day D – date M – month Y- year T – time Output: Thursday, 20th, February, 2014,22:18:19
  • 8. GROUP BY It is used to group the data. In other word it divide rows in a table in smaller group. select dept_no,sum(sal) from employee group by dept_no; Here, Employee - table_name Dept_no and sal - column_name
  • 9. HAVING It is used to applied condition on aggregate functions with group by. Example: select dept_no,max(sal) from employee group by dept_no having sum(sal)>100;