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

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

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;