SlideShare a Scribd company logo
1 of 18
MS SQL SERVER AND MYSQL
Day 1
Introduction
• Microsoft SQL Server is a relational database
management system which stores data in tabular
format that is columns and rows wise.

• Components of Sql server
1. Database Engine
2. Sql Server Integration Services (SSIS)
3. Sql Server Analyses Services (SSAS)
4. Sql Server Reporting Services (SSRS)
Database Engine
• Its task is to provide cores functionalities that
is storing and retrieving the data in very
efficient manner.
1. Creating database objects like table, view, stored procedure
etc.
2. Retrieving, updating, inserting, deleting or merging data from
different database objects.
3. Sending email notification when data is modified.
4. Perform some database scheduled jobs etc.
Integration Services(SSIS)
• It can load the 1 TB data in 30 minutes.
• Its task is to extract the data from different sources likes
databases, raw files, XML etc, perform some operations (likes
data cleaning, sending emails etc) and load the data into
different destinations.
• Download the data from FTP severs, correct the spelling, verb
forms etc of data and save in the XML file.
Analyses Services(SSAS)
• Its task is to create multi dimensional data
structure of an OLAP system, analyze and
aggregate the data. Also it implements
various data mining models.
1. Get the detail information of sold car over last 10 years for
that family which has three children.
2. Forecasting sales in coming year etc.
Reporting Services(SSIS)
• Generate a report by getting data from
different tables in PDF format.
• Generate a report to display total sales in
different location of a country in map view.
• Generate a pie chart to display purchase
volume.
Server Vs Client
1. What is difference between Sql Server and
SSMS?
2. What is difference between MySql Server
and MySql Workbench?
Server Vs Client
SELECT Statement
1. FROM
2. ON
3. JOIN
4. WHERE
5. GROUP BY
6. WITH CUBE or WITH ROLLUP
7. HAVING
8. SELECT
9. DISTINCT
10. ORDER BY
11. TOP
FROM Clause
• [Linked_Server].[Database_Name].[Schema_Name].[Table_Name]
WHERE Clause
• This clause filters the records from data
source.
• Wrongly written filter predicates(conditions)
can badly decreases the query performance.
Does order of predicates matters in
WHERE clause?
•
•

Comparison with string is costlier than integer comparison.
LIKE is itself a costly operator.

• Also if first filter condition will return less result set then
other filter condition has to perform less number of
comparisons.
ORDER BY Clause
• Syntax: ORDER BY <Expression>
[ASC | DESC]
[,…n]

• What is Default sort order?
TOP Clause
• Syntax: TOP(Expression) [PERCENT] [WITH TIES]
• Only specified first set or percent rows will be
returned.
• It returns random rows.
• MySql equivalent is LIMIT clause.
GROUP BY Clause
Student Name

Semester

Mathematics

Physics

Scott

1

20

30

Scott

2

15

20

Scott

3

25

25

Greg

1

18

25

Greg

2

20

35

Greg

3

22

24

Note: In MySql GROUP BY clause all sort the
data according group by columns.
Aggregate Function
•
•
•
•
•
•

COUNT
COUNT_BIG
AVG
MIN
MAX
SUM
HAVING Vs WHERE
• Syntax: [HAVING <Search Condition>]
• Having clause filters the records in the group.
• Where clause filter filters the records in the
table.
THANK YOU

More Related Content

What's hot (17)

Introduction to mysql part 4
Introduction to mysql part 4Introduction to mysql part 4
Introduction to mysql part 4
 
Big table
Big tableBig table
Big table
 
MS Sql Server: Introduction To Database Concepts
MS Sql Server: Introduction To Database ConceptsMS Sql Server: Introduction To Database Concepts
MS Sql Server: Introduction To Database Concepts
 
Mule database-connectors
Mule database-connectorsMule database-connectors
Mule database-connectors
 
Batch processing with watermark
Batch processing with watermarkBatch processing with watermark
Batch processing with watermark
 
Ibm db2
Ibm db2Ibm db2
Ibm db2
 
SQL vs MongoDB
SQL vs MongoDBSQL vs MongoDB
SQL vs MongoDB
 
Top new ssis 2012 features
Top new ssis 2012 featuresTop new ssis 2012 features
Top new ssis 2012 features
 
Lecture 40 1
Lecture 40 1Lecture 40 1
Lecture 40 1
 
Mysql database
Mysql databaseMysql database
Mysql database
 
Microsoft SQL Server - Files and Filegroups
Microsoft SQL Server - Files and FilegroupsMicrosoft SQL Server - Files and Filegroups
Microsoft SQL Server - Files and Filegroups
 
Schema Objects
Schema ObjectsSchema Objects
Schema Objects
 
Group Members
Group MembersGroup Members
Group Members
 
Datastage Online Training
Datastage Online TrainingDatastage Online Training
Datastage Online Training
 
Data definition language
Data definition languageData definition language
Data definition language
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 

Similar to Sql server introduction fundamental

Sql server introduction
Sql server introductionSql server introduction
Sql server introductionRiteshkiit
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architectureAjeet Singh
 
Cloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure toolsCloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure toolsPushkar Chivate
 
DataBase Management systems (IM).pptx
DataBase Management systems (IM).pptxDataBase Management systems (IM).pptx
DataBase Management systems (IM).pptxGooglePay16
 
7 - Enterprise IT in Action
7 - Enterprise IT in Action7 - Enterprise IT in Action
7 - Enterprise IT in ActionRaymond Gao
 
Sql interview question part 6
Sql interview question part 6Sql interview question part 6
Sql interview question part 6kaashiv1
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6kaashiv1
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6kaashiv1
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusChhom Karath
 
AWS (Amazon Redshift) presentation
AWS (Amazon Redshift) presentationAWS (Amazon Redshift) presentation
AWS (Amazon Redshift) presentationVolodymyr Rovetskiy
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptxKulbir4
 
MySQL 8.0 Featured for Developers
MySQL 8.0 Featured for DevelopersMySQL 8.0 Featured for Developers
MySQL 8.0 Featured for DevelopersDave Stokes
 
Kaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions PresentationKaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions Presentationkaashiv1
 
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloudKoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloudTobias Koprowski
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql serverVinay Thota
 
Windowing functions session for Slovak SQL Pass & BI
Windowing functions session for Slovak SQL Pass & BIWindowing functions session for Slovak SQL Pass & BI
Windowing functions session for Slovak SQL Pass & BIAndrej Zafka
 
Inb343 week2 sql server intro
Inb343 week2 sql server introInb343 week2 sql server intro
Inb343 week2 sql server introFredlive503
 

Similar to Sql server introduction fundamental (20)

Sql server introduction
Sql server introductionSql server introduction
Sql server introduction
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
Cloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure toolsCloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure tools
 
DataBase Management systems (IM).pptx
DataBase Management systems (IM).pptxDataBase Management systems (IM).pptx
DataBase Management systems (IM).pptx
 
7 - Enterprise IT in Action
7 - Enterprise IT in Action7 - Enterprise IT in Action
7 - Enterprise IT in Action
 
Ebook6
Ebook6Ebook6
Ebook6
 
Sql interview question part 6
Sql interview question part 6Sql interview question part 6
Sql interview question part 6
 
Ebook6
Ebook6Ebook6
Ebook6
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
 
AWS (Amazon Redshift) presentation
AWS (Amazon Redshift) presentationAWS (Amazon Redshift) presentation
AWS (Amazon Redshift) presentation
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptx
 
MySQL 8.0 Featured for Developers
MySQL 8.0 Featured for DevelopersMySQL 8.0 Featured for Developers
MySQL 8.0 Featured for Developers
 
Kaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions PresentationKaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions Presentation
 
Distributed query deep dive conor cunningham
Distributed query deep dive   conor cunninghamDistributed query deep dive   conor cunningham
Distributed query deep dive conor cunningham
 
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloudKoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
KoprowskiT_SQLSat230_Rheinland_SQLAzure-fromPlantoBackuptoCloud
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
 
Windowing functions session for Slovak SQL Pass & BI
Windowing functions session for Slovak SQL Pass & BIWindowing functions session for Slovak SQL Pass & BI
Windowing functions session for Slovak SQL Pass & BI
 
Inb343 week2 sql server intro
Inb343 week2 sql server introInb343 week2 sql server intro
Inb343 week2 sql server intro
 

More from Riteshkiit

Backup and restore
Backup and restoreBackup and restore
Backup and restoreRiteshkiit
 
Database index
Database indexDatabase index
Database indexRiteshkiit
 
Query parameterization
Query parameterizationQuery parameterization
Query parameterizationRiteshkiit
 
Order by and join
Order by and joinOrder by and join
Order by and joinRiteshkiit
 
Database design
Database designDatabase design
Database designRiteshkiit
 
Sql server JOIN
Sql server JOINSql server JOIN
Sql server JOINRiteshkiit
 
Sql query performance analysis
Sql query performance analysisSql query performance analysis
Sql query performance analysisRiteshkiit
 
Sql query performance analysis
Sql query performance analysisSql query performance analysis
Sql query performance analysisRiteshkiit
 

More from Riteshkiit (14)

Backup and restore
Backup and restoreBackup and restore
Backup and restore
 
Database index
Database indexDatabase index
Database index
 
Query parameterization
Query parameterizationQuery parameterization
Query parameterization
 
Index_2
Index_2Index_2
Index_2
 
Order by and join
Order by and joinOrder by and join
Order by and join
 
Database design
Database designDatabase design
Database design
 
Statistics
StatisticsStatistics
Statistics
 
Index
IndexIndex
Index
 
Addhoc query
Addhoc queryAddhoc query
Addhoc query
 
Sql server JOIN
Sql server JOINSql server JOIN
Sql server JOIN
 
Sql server 2
Sql server 2Sql server 2
Sql server 2
 
Sql query performance analysis
Sql query performance analysisSql query performance analysis
Sql query performance analysis
 
Sql query performance analysis
Sql query performance analysisSql query performance analysis
Sql query performance analysis
 
Topics
TopicsTopics
Topics
 

Recently uploaded

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Sql server introduction fundamental

  • 1. MS SQL SERVER AND MYSQL Day 1
  • 2. Introduction • Microsoft SQL Server is a relational database management system which stores data in tabular format that is columns and rows wise. • Components of Sql server 1. Database Engine 2. Sql Server Integration Services (SSIS) 3. Sql Server Analyses Services (SSAS) 4. Sql Server Reporting Services (SSRS)
  • 3. Database Engine • Its task is to provide cores functionalities that is storing and retrieving the data in very efficient manner. 1. Creating database objects like table, view, stored procedure etc. 2. Retrieving, updating, inserting, deleting or merging data from different database objects. 3. Sending email notification when data is modified. 4. Perform some database scheduled jobs etc.
  • 4. Integration Services(SSIS) • It can load the 1 TB data in 30 minutes. • Its task is to extract the data from different sources likes databases, raw files, XML etc, perform some operations (likes data cleaning, sending emails etc) and load the data into different destinations. • Download the data from FTP severs, correct the spelling, verb forms etc of data and save in the XML file.
  • 5. Analyses Services(SSAS) • Its task is to create multi dimensional data structure of an OLAP system, analyze and aggregate the data. Also it implements various data mining models. 1. Get the detail information of sold car over last 10 years for that family which has three children. 2. Forecasting sales in coming year etc.
  • 6. Reporting Services(SSIS) • Generate a report by getting data from different tables in PDF format. • Generate a report to display total sales in different location of a country in map view. • Generate a pie chart to display purchase volume.
  • 7. Server Vs Client 1. What is difference between Sql Server and SSMS? 2. What is difference between MySql Server and MySql Workbench?
  • 9. SELECT Statement 1. FROM 2. ON 3. JOIN 4. WHERE 5. GROUP BY 6. WITH CUBE or WITH ROLLUP 7. HAVING 8. SELECT 9. DISTINCT 10. ORDER BY 11. TOP
  • 11. WHERE Clause • This clause filters the records from data source. • Wrongly written filter predicates(conditions) can badly decreases the query performance.
  • 12. Does order of predicates matters in WHERE clause? • • Comparison with string is costlier than integer comparison. LIKE is itself a costly operator. • Also if first filter condition will return less result set then other filter condition has to perform less number of comparisons.
  • 13. ORDER BY Clause • Syntax: ORDER BY <Expression> [ASC | DESC] [,…n] • What is Default sort order?
  • 14. TOP Clause • Syntax: TOP(Expression) [PERCENT] [WITH TIES] • Only specified first set or percent rows will be returned. • It returns random rows. • MySql equivalent is LIMIT clause.
  • 15. GROUP BY Clause Student Name Semester Mathematics Physics Scott 1 20 30 Scott 2 15 20 Scott 3 25 25 Greg 1 18 25 Greg 2 20 35 Greg 3 22 24 Note: In MySql GROUP BY clause all sort the data according group by columns.
  • 17. HAVING Vs WHERE • Syntax: [HAVING <Search Condition>] • Having clause filters the records in the group. • Where clause filter filters the records in the table.