SlideShare a Scribd company logo
1 of 12
Data Analyst
By: Dila Triarini
Practice SQL for
Data Analysis
JOIN THE BEST UPSKILLING COMMUNITY
WITH ME at myskill.id/bootcamp
FULLSTACK INTENSIVE BOOTCAMP
MINI PORTOFOLIO
#RintisKarirImpian
Course Summary
Aggregate Functions
Aggregate functions compute a single result from a set of input values.
Aggregate functions Description Syntax
avg(expression)
the average (arithmetic mean) of all
non-null input values
SELECT AVG(column_name) FROM table_name
count(expression)
number of input rows for which the
value of expression is not null
SELECT COUNT(column_name) FROM table_name
DISTINCT clause can be used with the
COUNT function to count only
unique/distinct values of a table
SELECT COUNT(DISTINCT column_name) FROM
table_name
max(expression)
maximum value of expression across
all non-null input values
SELECT MAX(column_name) FROM table_name
min(expression)
Minimum value of expression across
all non-null input values
SELECT MIN(column_name) FROM table_name
sum(expression)
sum of expression across all non-null
input values
SELECT SUM(column_name) FROM table_name
#RintisKarirImpian
Course Summary
GROUP BY Clause
The PostgreSQL GROUP BY clause is used to divide rows returned by SELECT statement into different
groups.(https://www.geeksforgeeks.org/postgresql-group-by-clause/) .
Aggregate functions are commonly combined with GROUP BY to group/categorized data based on one or more rows
Syntax Example
SELECT
column_1,
column_2,
computing_function(column_3)
FROM
table_name
GROUP BY
column_1,
column_2;
#RintisKarirImpian
Course Summary
HAVING Clause
The HAVING clause specifies a search condition for a group or an aggregate. The HAVING clause is often used with the
GROUP BY clause to filter groups or aggregates based on a specified condition
(https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-having/).
Syntax Example
SELECT
column1,
aggregate_function (column2)
FROM
table_name
GROUP BY
column1
HAVING
condition;
#RintisKarirImpian
Case Study
1. What is the best selling product based on its selling quantity?
#RintisKarirImpian
Case Study
3. Consumer named Joel Eaton ask for transaction recap related to product name and its quantity
which he have bought in Tokopaedi. Please create the transaction recap!
#RintisKarirImpian
Case Study
4. When did Tokopaedi receive the most orders?
#RintisKarirImpian
Case Study
2. You need to give a promotion to 100 individual consumers (segment = ‘Consumer’) with the highest order average.
Please create the list of those consumer!
#RintisKarirImpian
Case Study
5. What product does have the most average profit per unit?
#RintisKarirImpian
Course Summary
SQL Join
Aggregate functions compute a single result from a set of input values.
#RintisKarirImpian
Case Study
1. [tokopaedi] Please create list of consumer with average spending per transaction is higher
than average spending all consumer!
There are 291 customer with average spending per
transaction higher than the average spending all
consumer
Follow me!
Instagram : dilatriarini
Twitter : dilatriarini
LinkedIn : Dila Triarini
Bootcamp Data Analysis
by @myskill.id

More Related Content

Similar to Case 9 and 10. SQL For Data Analysis 4.pptx

MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index TuningManikanda kumar
 
03 ohp slides 1
03 ohp slides 103 ohp slides 1
03 ohp slides 1Anne Lee
 
Mysql Aggregate
Mysql AggregateMysql Aggregate
Mysql Aggregatelotlot
 
Structured query language(sql)
Structured query language(sql)Structured query language(sql)
Structured query language(sql)Huda Alameen
 
The Database Environment Chapter 8
The Database Environment Chapter 8The Database Environment Chapter 8
The Database Environment Chapter 8Jeanie Arnoco
 
Web Developer make the most out of your Database !
Web Developer make the most out of your Database !Web Developer make the most out of your Database !
Web Developer make the most out of your Database !Jean-Marc Desvaux
 
Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server iiIblesoft
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic ConceptsTony Wong
 
Advanced Spreadsheet Skills-1.pptx
Advanced Spreadsheet Skills-1.pptxAdvanced Spreadsheet Skills-1.pptx
Advanced Spreadsheet Skills-1.pptxCliffordBorromeo
 
Oracle SQL - Grants, filters, groups and more
Oracle SQL - Grants, filters, groups and moreOracle SQL - Grants, filters, groups and more
Oracle SQL - Grants, filters, groups and moreA Data Guru
 
9 - Advanced Functions in MS Excel.pptx
9 - Advanced Functions in MS Excel.pptx9 - Advanced Functions in MS Excel.pptx
9 - Advanced Functions in MS Excel.pptxSheryldeVilla2
 
Stored procedure tuning and optimization t sql
Stored procedure tuning and optimization t sqlStored procedure tuning and optimization t sql
Stored procedure tuning and optimization t sqlnishantdavid9
 
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfStep 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfaloeplusint
 
e computer notes - Aggregating data using group functions
e computer notes -  Aggregating data using group functionse computer notes -  Aggregating data using group functions
e computer notes - Aggregating data using group functionsecomputernotes
 

Similar to Case 9 and 10. SQL For Data Analysis 4.pptx (20)

MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index Tuning
 
Sql functions
Sql functionsSql functions
Sql functions
 
03 ohp slides 1
03 ohp slides 103 ohp slides 1
03 ohp slides 1
 
Chapter9 more on database and sql
Chapter9 more on database and sqlChapter9 more on database and sql
Chapter9 more on database and sql
 
Mysql Aggregate
Mysql AggregateMysql Aggregate
Mysql Aggregate
 
Structured query language(sql)
Structured query language(sql)Structured query language(sql)
Structured query language(sql)
 
MySQL Indexes
MySQL IndexesMySQL Indexes
MySQL Indexes
 
The Database Environment Chapter 8
The Database Environment Chapter 8The Database Environment Chapter 8
The Database Environment Chapter 8
 
Web Developer make the most out of your Database !
Web Developer make the most out of your Database !Web Developer make the most out of your Database !
Web Developer make the most out of your Database !
 
Sql
SqlSql
Sql
 
Ms sql server ii
Ms sql server  iiMs sql server  ii
Ms sql server ii
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
Advanced Spreadsheet Skills-1.pptx
Advanced Spreadsheet Skills-1.pptxAdvanced Spreadsheet Skills-1.pptx
Advanced Spreadsheet Skills-1.pptx
 
Excel_useful_tips
Excel_useful_tipsExcel_useful_tips
Excel_useful_tips
 
Oracle SQL - Grants, filters, groups and more
Oracle SQL - Grants, filters, groups and moreOracle SQL - Grants, filters, groups and more
Oracle SQL - Grants, filters, groups and more
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
9 - Advanced Functions in MS Excel.pptx
9 - Advanced Functions in MS Excel.pptx9 - Advanced Functions in MS Excel.pptx
9 - Advanced Functions in MS Excel.pptx
 
Stored procedure tuning and optimization t sql
Stored procedure tuning and optimization t sqlStored procedure tuning and optimization t sql
Stored procedure tuning and optimization t sql
 
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfStep 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
 
e computer notes - Aggregating data using group functions
e computer notes -  Aggregating data using group functionse computer notes -  Aggregating data using group functions
e computer notes - Aggregating data using group functions
 

More from DilaTriarini1

Case 8. SQL Basic 2 and Analyzing Business Data Using SQL.pptx
Case 8. SQL Basic 2 and Analyzing Business Data Using SQL.pptxCase 8. SQL Basic 2 and Analyzing Business Data Using SQL.pptx
Case 8. SQL Basic 2 and Analyzing Business Data Using SQL.pptxDilaTriarini1
 
Case 7. SQL Basic 2.pptx
Case 7. SQL Basic 2.pptxCase 7. SQL Basic 2.pptx
Case 7. SQL Basic 2.pptxDilaTriarini1
 
Case 6. SQL Basic 1.pptx
Case 6. SQL Basic 1.pptxCase 6. SQL Basic 1.pptx
Case 6. SQL Basic 1.pptxDilaTriarini1
 
Case 5. Data Formatting & Cleansing.pptx
Case 5. Data Formatting & Cleansing.pptxCase 5. Data Formatting & Cleansing.pptx
Case 5. Data Formatting & Cleansing.pptxDilaTriarini1
 
Case 4. The Metrics_ Measure What Matters.pptx
Case 4. The Metrics_ Measure What Matters.pptxCase 4. The Metrics_ Measure What Matters.pptx
Case 4. The Metrics_ Measure What Matters.pptxDilaTriarini1
 
Case 3. Introduction to Statistic.pptx
Case 3. Introduction to Statistic.pptxCase 3. Introduction to Statistic.pptx
Case 3. Introduction to Statistic.pptxDilaTriarini1
 
Case 2. What is Data Analyst.pptx
Case 2. What is Data Analyst.pptxCase 2. What is Data Analyst.pptx
Case 2. What is Data Analyst.pptxDilaTriarini1
 

More from DilaTriarini1 (7)

Case 8. SQL Basic 2 and Analyzing Business Data Using SQL.pptx
Case 8. SQL Basic 2 and Analyzing Business Data Using SQL.pptxCase 8. SQL Basic 2 and Analyzing Business Data Using SQL.pptx
Case 8. SQL Basic 2 and Analyzing Business Data Using SQL.pptx
 
Case 7. SQL Basic 2.pptx
Case 7. SQL Basic 2.pptxCase 7. SQL Basic 2.pptx
Case 7. SQL Basic 2.pptx
 
Case 6. SQL Basic 1.pptx
Case 6. SQL Basic 1.pptxCase 6. SQL Basic 1.pptx
Case 6. SQL Basic 1.pptx
 
Case 5. Data Formatting & Cleansing.pptx
Case 5. Data Formatting & Cleansing.pptxCase 5. Data Formatting & Cleansing.pptx
Case 5. Data Formatting & Cleansing.pptx
 
Case 4. The Metrics_ Measure What Matters.pptx
Case 4. The Metrics_ Measure What Matters.pptxCase 4. The Metrics_ Measure What Matters.pptx
Case 4. The Metrics_ Measure What Matters.pptx
 
Case 3. Introduction to Statistic.pptx
Case 3. Introduction to Statistic.pptxCase 3. Introduction to Statistic.pptx
Case 3. Introduction to Statistic.pptx
 
Case 2. What is Data Analyst.pptx
Case 2. What is Data Analyst.pptxCase 2. What is Data Analyst.pptx
Case 2. What is Data Analyst.pptx
 

Recently uploaded

VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 

Recently uploaded (20)

VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 

Case 9 and 10. SQL For Data Analysis 4.pptx

  • 1. Data Analyst By: Dila Triarini Practice SQL for Data Analysis JOIN THE BEST UPSKILLING COMMUNITY WITH ME at myskill.id/bootcamp FULLSTACK INTENSIVE BOOTCAMP MINI PORTOFOLIO
  • 2. #RintisKarirImpian Course Summary Aggregate Functions Aggregate functions compute a single result from a set of input values. Aggregate functions Description Syntax avg(expression) the average (arithmetic mean) of all non-null input values SELECT AVG(column_name) FROM table_name count(expression) number of input rows for which the value of expression is not null SELECT COUNT(column_name) FROM table_name DISTINCT clause can be used with the COUNT function to count only unique/distinct values of a table SELECT COUNT(DISTINCT column_name) FROM table_name max(expression) maximum value of expression across all non-null input values SELECT MAX(column_name) FROM table_name min(expression) Minimum value of expression across all non-null input values SELECT MIN(column_name) FROM table_name sum(expression) sum of expression across all non-null input values SELECT SUM(column_name) FROM table_name
  • 3. #RintisKarirImpian Course Summary GROUP BY Clause The PostgreSQL GROUP BY clause is used to divide rows returned by SELECT statement into different groups.(https://www.geeksforgeeks.org/postgresql-group-by-clause/) . Aggregate functions are commonly combined with GROUP BY to group/categorized data based on one or more rows Syntax Example SELECT column_1, column_2, computing_function(column_3) FROM table_name GROUP BY column_1, column_2;
  • 4. #RintisKarirImpian Course Summary HAVING Clause The HAVING clause specifies a search condition for a group or an aggregate. The HAVING clause is often used with the GROUP BY clause to filter groups or aggregates based on a specified condition (https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-having/). Syntax Example SELECT column1, aggregate_function (column2) FROM table_name GROUP BY column1 HAVING condition;
  • 5. #RintisKarirImpian Case Study 1. What is the best selling product based on its selling quantity?
  • 6. #RintisKarirImpian Case Study 3. Consumer named Joel Eaton ask for transaction recap related to product name and its quantity which he have bought in Tokopaedi. Please create the transaction recap!
  • 7. #RintisKarirImpian Case Study 4. When did Tokopaedi receive the most orders?
  • 8. #RintisKarirImpian Case Study 2. You need to give a promotion to 100 individual consumers (segment = ‘Consumer’) with the highest order average. Please create the list of those consumer!
  • 9. #RintisKarirImpian Case Study 5. What product does have the most average profit per unit?
  • 10. #RintisKarirImpian Course Summary SQL Join Aggregate functions compute a single result from a set of input values.
  • 11. #RintisKarirImpian Case Study 1. [tokopaedi] Please create list of consumer with average spending per transaction is higher than average spending all consumer! There are 291 customer with average spending per transaction higher than the average spending all consumer
  • 12. Follow me! Instagram : dilatriarini Twitter : dilatriarini LinkedIn : Dila Triarini Bootcamp Data Analysis by @myskill.id