SlideShare a Scribd company logo
1 of 34
Download to read offline
Question: Write a query that displays the order ID, account ID, and total dollar amount for
all the orders, sorted first by the account ID (in ascending order), and then by the total
amount (in descending order).
Answer:
Question: Pulls the first 5 rows and all columns from the orders table that have a dollar amount o f
gloss_amt_usd greater than or equal to 1000.
Answer:
Question: Filter the accounts table to include the company name, website, and the primary point of
contact (primary_poc) just for the Exxon Mobil company in the accounts table.
Answer:
Questions: Create a column that divides the standard_amt_usd by the standard_qty to find the unit
price for standard paper for each order. Limit the results to the first 10 orders, and include
the id and account_id fields.
Answer:
Question: All the companies whose names start with 'C'.
Answer:
Question: All companies whose names contain the string 'one' somewhere in the name.
Answer:
Question: All companies whose names end with 's'.
Answer:
Question: Use the web_events table to find all information regarding individuals who were
contacted via the channel of organic or adwords.
Answer:
Question: Write a query that returns all the orders where the standard_qty is over 1000,
the poster_qty is 0, and the gloss_qty is 0.
Answer:
Question: When you use the BETWEEN operator in SQL, do the results include the values of your
endpoints, or not? Figure out the answer to this important question by writing a query that displays
the order date and gloss_qty data for all orders where gloss_qty is between 24 and 29. Then look
at your output to see if the BETWEEN operator included the begin and end values or not.
Answer:
Question: You will notice that using BETWEEN is tricky for dates! While BETWEEN is generally
inclusive of endpoints, it assumes the time is at 00:00:00 (i.e. midnight) for dates. This is the reason
why we set the right-side endpoint of the period at '2017-01-01'.
Answer:
Question: Write a query that returns a list of orders where the standard_qty is zero and either
the gloss_qty or poster_qty is over 1000.
Answer:
Question: Find all the company names that start with a 'C' or 'W', and the primary
contact contains 'ana' or 'Ana', but it doesn't contain 'eana'.
Answer:
Question: Try pulling standard_qty, gloss_qty, and poster_qty from the orders table, and
the website and the primary_poc from the accounts table.
Answer:
ERD diagram:
Question: Provide a table for all web_events associated with account name of Walmart. There
should be three columns. Be sure to include the primary_poc, time of the event, and the channel for
each event. Additionally, you might choose to add a fourth column to assure only Walmart events
were chosen.
Answer:
Question: Provide the name for each region for every order, as well as the account name and
the unit price they paid (total_amt_usd/total) for the order. Your final table should have 3
columns: region name, account name, and unit price. A few accounts have 0 for total, so I divided
by (total + 0.01) to assure not dividing by zero.
Answer:
Question: Provide a table that provides the region for each sales_rep along with their
associated accounts. This time only for accounts where the sales rep has a first name starting
with S and in the Midwest region. Your final table should include three columns: the region name,
the sales rep name, and the account name. Sort the accounts alphabetically (A-Z) according to
account name.
Answer:
1.
Question: Provide the name for each region for every order, as well as the account name and
the unit price they paid (total_amt_usd/total) for the order. However, you should only provide the
results if the standard order quantity exceeds 100 and the poster order quantity exceeds 50.
Your final table should have 3 columns: region name, account name, and unit price. Sort for the
smallest unit price first. In order to avoid a division by zero error, adding .01 to the denominator
here is helpful (total_amt_usd/(total+0.01).
Answer:
Question: What are the different channels used by account id 1001? Your final table should have
only 2 columns: account name and the different channels. You can try SELECT DISTINCT to
narrow down the results to only the unique values.
Answer:
Question: Find all the orders that occurred in 2015. Your final table should have 4
columns: occurred_at, account name, order total, and order total_amt_usd.
Answer:
Question: Find the total amount spent on standard_amt_usd and gloss_amt_usd paper for
each order in the orders table. This should give a dollar amount for each order in the table.
Answer:
Question : Find the mean (AVERAGE) amount spent per order on each paper type, as well
as the mean amount of each paper type purchased per order. Your final answer should have
6 values - one for each paper type for the average number of sales, as well as the average
amount.
Answer:
Question: Who was the primary contact associated with the earliest web_event?
Answer:
Question: What was the smallest order placed by each account in terms of total usd.
Provide only two columns - the account name and the total usd. Order from smallest dollar
amounts to largest
Answer:
Question: Find the number of sales reps in each region. Your final table should have two
columns - the region and the number of sales_reps. Order from fewest reps to most reps.
Answer:
Question: Determine the number of times a particular channel was used in
the web_events table for each region. Your final table should have three columns -
the region name, the channel, and the number of occurrences. Order your table with the
highest number of occurrences first.
Answer:
Question : How many of the sales reps have more than 5 accounts that they manage?
Answer:
Question : How many accounts have more than 20 orders?
Answer:
Question: Which account has the most orders?
Answer:
Question : How many accounts spent more than 30,000 usd total across all orders?
Answer :
Question : How many accounts spent less than 1,000 usd total across all orders?
Answer :
Question : Which account has spent the most with us?
Answer :
Question : Which accounts used facebook as a channel to contact customers more than 6
times?
Answer :
Question : Which account used facebook most as a channel?
Answer:
Question : Which channel was most frequently used by most accounts?
Answer :
Question : Find the sales in terms of total dollars for all orders in each year, ordered from
greatest to least. Do you notice any trends in the yearly sales totals?
Answer :
Question : In which month of which year did Walmart spend the most on gloss paper in
terms of dollars?
Answer:
Question : We would now like to perform a similar calculation to the first, but we want to
obtain the total amount spent by customers only in 2016 and 2017. Keep the same levels as
in the previous question. Order with the top spending customers listed first.
Answer :
Question : The previous didn't account for the middle, nor the dollar amount associated
with the sales. Management decides they want to see these characteristics represented as
well. We would like to identify top performing sales reps, which are sales reps associated
with more than 200 orders or more than 750000 in total sales. The middle group has
any rep with more than 150 orders or 500000 in sales. Create a table with the sales rep
name, the total number of orders, total sales across all orders, and a column
with top, middle, or low depending on this criteria. Place the top sales people based on
dollar amount of sales first in your final table.
Answer :
Question : Provide the name of the sales_rep in each region with the largest amount
of total_amt_usd sales.
Answer:
First, I wanted to find the total_amt_usd totals associated with each sales rep, and I also
wanted the region in which they were located. The query below provided this information.
Next, I pulled the max for each region, and then we can use this to pull those rows in
our final result.
Essentially, this is a JOIN of these two tables, where the region and amount match.
Question : How many accounts had more total purchases than the account name which
has bought the most standard_qty paper throughout their lifetime as a customer?
Answer :
First, we want to find the account that had the most standard_qty paper. The query here
pulls that account, as well as the total amount:
Now, I want to use this to pull all the accounts with more total sales:
This is now a list of all the accounts with more total orders. We can get the count with just
another simple subquery.
Question : For the customer that spent the most (in total over their lifetime as a
customer) total_amt_usd, how many web_events did they have for each channel.
Answer :
Here, we first want to pull the customer with the most spent in lifetime value.
Now, we want to look at the number of events on each channel this company had, which we
can match with just the id.
Question : What is the lifetime average amount spent in terms of total_amt_usd for the top
10 total spending accounts?
Answer :
First, we just want to find the top 10 accounts in terms of highest total_amt_usd.
Now, we just want the average of these 10 amounts.
Question : What is the lifetime average amount spent in terms of total_amt_usd, including
only the companies that spent more per order, on average, than the average of all orders.
Answer :
First, we want to pull the average of all accounts in terms of total_amt_usd
Then, we want to only pull the accounts with more than this average amount.
Finally, we just want the average of these values
Question : There are 350 company names that start with a letter and 1 that starts with a
number. This gives a ratio of 350/351 that are company names that start with a letter or
99.7%.
Answer :
Question : There are 80 company names that start with a vowel and 271 that start with
other characters. Therefore 80/351 are vowels or 22.8%. Therefore, 77.2% of company
names do not start with vowels.
Answer:
Question : Use the accounts table to create first and last name columns that hold the first and last
names for the primary_poc
Answer :
Question : We would also like to create an initial password, which they will change after
their first log in. The first password will be the first letter of the primary_poc's first name
(lowercase), then the last letter of their first name (lowercase), the first letter of their last
name (lowercase), the last letter of their last name (lowercase), the number of letters in
their first name, the number of letters in their last name, and then the name of the company
they are working with, all capitalized with no spaces.
Answer:
Question : Use the NTILE functionality to divide the accounts into 4 levels in terms of the
amount of standard_qty for their orders. Your resulting table should have the account_id,
the occurred_at time for each order, the total amount of standard_qty paper purchased,
and one of four levels in a standard_quartile column.
Answer :
Question : Use the NTILE functionality to divide the accounts into two levels in terms of the
amount of gloss_qty for their orders. Your resulting table should have the account_id,
the occurred_at time for each order, the total amount of gloss_qty paper purchased, and
one of two levels in a gloss_half column.
Answer :
Question : What is the relationship
between accounts.primary_poc and sales_reps.name?
Answer:
portfolio for data analytics.pdf

More Related Content

What's hot

CP-SAT - Certified Professional Selenium Automation Testing
CP-SAT - Certified Professional Selenium Automation TestingCP-SAT - Certified Professional Selenium Automation Testing
CP-SAT - Certified Professional Selenium Automation TestingAgile Testing Alliance
 
Start-up Business Plan in US - Asian House Restaurant in US
Start-up Business Plan in US - Asian House Restaurant in USStart-up Business Plan in US - Asian House Restaurant in US
Start-up Business Plan in US - Asian House Restaurant in USChormvirak Moulsem
 
SaaS Marketing Plan: 5 Ways to Get your B2B App to Sell Itself
SaaS Marketing Plan: 5 Ways to Get your B2B App to Sell ItselfSaaS Marketing Plan: 5 Ways to Get your B2B App to Sell Itself
SaaS Marketing Plan: 5 Ways to Get your B2B App to Sell ItselfLincoln Murphy
 
How startups create a frictionless experience. +30 cases by @boardofinno
How startups create a frictionless experience. +30 cases by @boardofinnoHow startups create a frictionless experience. +30 cases by @boardofinno
How startups create a frictionless experience. +30 cases by @boardofinnoBoard of Innovation
 
Building an enterprise sales strategy
Building an enterprise sales strategyBuilding an enterprise sales strategy
Building an enterprise sales strategyLinda Cadigan
 
CallRail - Call Tracking & Analytics
CallRail - Call Tracking & AnalyticsCallRail - Call Tracking & Analytics
CallRail - Call Tracking & AnalyticsCallRail
 
2021_Vermont_Private_Investment_Landscape_Cairn_Cross_FreshTracks_V4.pptx
2021_Vermont_Private_Investment_Landscape_Cairn_Cross_FreshTracks_V4.pptx2021_Vermont_Private_Investment_Landscape_Cairn_Cross_FreshTracks_V4.pptx
2021_Vermont_Private_Investment_Landscape_Cairn_Cross_FreshTracks_V4.pptxCairnCross1
 
Justdial is yellow pages on telephone . Here's a ppt on its marketing strateg...
Justdial is yellow pages on telephone . Here's a ppt on its marketing strateg...Justdial is yellow pages on telephone . Here's a ppt on its marketing strateg...
Justdial is yellow pages on telephone . Here's a ppt on its marketing strateg...Shlomoh Samuel
 
Mastering the Upsell
Mastering the UpsellMastering the Upsell
Mastering the UpsellGainsight
 
Top 10 legal compliance officer interview questions and answers
Top 10 legal compliance officer interview questions and answersTop 10 legal compliance officer interview questions and answers
Top 10 legal compliance officer interview questions and answerstonychoper3206
 
Client Onboarding PowerPoint Presentation Slides
Client Onboarding PowerPoint Presentation SlidesClient Onboarding PowerPoint Presentation Slides
Client Onboarding PowerPoint Presentation SlidesSlideTeam
 
ALEX'S Hair Salon Strategy Analysis
ALEX'S Hair Salon Strategy AnalysisALEX'S Hair Salon Strategy Analysis
ALEX'S Hair Salon Strategy Analysisharbine
 
Why You Should Hire Me
Why You Should Hire MeWhy You Should Hire Me
Why You Should Hire Memdeava
 
Wholesaling Ebook Pdf
Wholesaling Ebook PdfWholesaling Ebook Pdf
Wholesaling Ebook PdfTaylorRousso
 
Top 5 implementation engineer interview questions with answers
Top 5 implementation engineer interview questions with answersTop 5 implementation engineer interview questions with answers
Top 5 implementation engineer interview questions with answersninami11
 

What's hot (20)

CP-SAT - Certified Professional Selenium Automation Testing
CP-SAT - Certified Professional Selenium Automation TestingCP-SAT - Certified Professional Selenium Automation Testing
CP-SAT - Certified Professional Selenium Automation Testing
 
Amazon payment
Amazon paymentAmazon payment
Amazon payment
 
Start-up Business Plan in US - Asian House Restaurant in US
Start-up Business Plan in US - Asian House Restaurant in USStart-up Business Plan in US - Asian House Restaurant in US
Start-up Business Plan in US - Asian House Restaurant in US
 
SaaS Marketing Plan: 5 Ways to Get your B2B App to Sell Itself
SaaS Marketing Plan: 5 Ways to Get your B2B App to Sell ItselfSaaS Marketing Plan: 5 Ways to Get your B2B App to Sell Itself
SaaS Marketing Plan: 5 Ways to Get your B2B App to Sell Itself
 
How startups create a frictionless experience. +30 cases by @boardofinno
How startups create a frictionless experience. +30 cases by @boardofinnoHow startups create a frictionless experience. +30 cases by @boardofinno
How startups create a frictionless experience. +30 cases by @boardofinno
 
Building an enterprise sales strategy
Building an enterprise sales strategyBuilding an enterprise sales strategy
Building an enterprise sales strategy
 
CallRail - Call Tracking & Analytics
CallRail - Call Tracking & AnalyticsCallRail - Call Tracking & Analytics
CallRail - Call Tracking & Analytics
 
2021_Vermont_Private_Investment_Landscape_Cairn_Cross_FreshTracks_V4.pptx
2021_Vermont_Private_Investment_Landscape_Cairn_Cross_FreshTracks_V4.pptx2021_Vermont_Private_Investment_Landscape_Cairn_Cross_FreshTracks_V4.pptx
2021_Vermont_Private_Investment_Landscape_Cairn_Cross_FreshTracks_V4.pptx
 
Justdial is yellow pages on telephone . Here's a ppt on its marketing strateg...
Justdial is yellow pages on telephone . Here's a ppt on its marketing strateg...Justdial is yellow pages on telephone . Here's a ppt on its marketing strateg...
Justdial is yellow pages on telephone . Here's a ppt on its marketing strateg...
 
Pre-Sales the Backbone of Sales Force Automation Solutions
Pre-Sales the Backbone of Sales Force Automation SolutionsPre-Sales the Backbone of Sales Force Automation Solutions
Pre-Sales the Backbone of Sales Force Automation Solutions
 
Mastering the Upsell
Mastering the UpsellMastering the Upsell
Mastering the Upsell
 
Top 10 legal compliance officer interview questions and answers
Top 10 legal compliance officer interview questions and answersTop 10 legal compliance officer interview questions and answers
Top 10 legal compliance officer interview questions and answers
 
Sales plan
Sales planSales plan
Sales plan
 
Client Onboarding PowerPoint Presentation Slides
Client Onboarding PowerPoint Presentation SlidesClient Onboarding PowerPoint Presentation Slides
Client Onboarding PowerPoint Presentation Slides
 
Just Dial PPT
Just Dial PPTJust Dial PPT
Just Dial PPT
 
ALEX'S Hair Salon Strategy Analysis
ALEX'S Hair Salon Strategy AnalysisALEX'S Hair Salon Strategy Analysis
ALEX'S Hair Salon Strategy Analysis
 
Why You Should Hire Me
Why You Should Hire MeWhy You Should Hire Me
Why You Should Hire Me
 
Wholesaling Ebook Pdf
Wholesaling Ebook PdfWholesaling Ebook Pdf
Wholesaling Ebook Pdf
 
Top 5 implementation engineer interview questions with answers
Top 5 implementation engineer interview questions with answersTop 5 implementation engineer interview questions with answers
Top 5 implementation engineer interview questions with answers
 
Food truck business plan
Food truck business planFood truck business plan
Food truck business plan
 

Similar to portfolio for data analytics.pdf

De vry math 399 ilabs & discussions latest 2016
De vry math 399 ilabs & discussions latest 2016De vry math 399 ilabs & discussions latest 2016
De vry math 399 ilabs & discussions latest 2016lenasour
 
De vry math 399 ilabs & discussions latest 2016 november
De vry math 399 ilabs & discussions latest 2016 novemberDe vry math 399 ilabs & discussions latest 2016 november
De vry math 399 ilabs & discussions latest 2016 novemberlenasour
 
FIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COM
FIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COMFIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COM
FIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COMalber22po
 
As with all projects in this course, your program’s output wil.docx
As with all projects in this course, your program’s output wil.docxAs with all projects in this course, your program’s output wil.docx
As with all projects in this course, your program’s output wil.docxrandymartin91030
 
De vry math 399 all ilabs latest 2016 november
De vry math 399 all ilabs latest 2016 novemberDe vry math 399 all ilabs latest 2016 november
De vry math 399 all ilabs latest 2016 novemberlenasour
 
Cte math test_answer_key
Cte math test_answer_keyCte math test_answer_key
Cte math test_answer_keynavajomath
 
Link to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docx
Link to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docxLink to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docx
Link to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docxSHIVA101531
 
Statement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxStatement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxwhitneyleman54422
 
Week 5 & 6 Query Project  Open the CUSTOMER file .docx
Week 5 & 6 Query Project    Open the CUSTOMER file  .docxWeek 5 & 6 Query Project    Open the CUSTOMER file  .docx
Week 5 & 6 Query Project  Open the CUSTOMER file .docxmelbruce90096
 

Similar to portfolio for data analytics.pdf (11)

De vry math 399 ilabs & discussions latest 2016
De vry math 399 ilabs & discussions latest 2016De vry math 399 ilabs & discussions latest 2016
De vry math 399 ilabs & discussions latest 2016
 
De vry math 399 ilabs & discussions latest 2016 november
De vry math 399 ilabs & discussions latest 2016 novemberDe vry math 399 ilabs & discussions latest 2016 november
De vry math 399 ilabs & discussions latest 2016 november
 
FIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COM
FIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COMFIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COM
FIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COM
 
As with all projects in this course, your program’s output wil.docx
As with all projects in this course, your program’s output wil.docxAs with all projects in this course, your program’s output wil.docx
As with all projects in this course, your program’s output wil.docx
 
De vry math 399 all ilabs latest 2016 november
De vry math 399 all ilabs latest 2016 novemberDe vry math 399 all ilabs latest 2016 november
De vry math 399 all ilabs latest 2016 november
 
Cte math test_answer_key
Cte math test_answer_keyCte math test_answer_key
Cte math test_answer_key
 
Link to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docx
Link to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docxLink to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docx
Link to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docx
 
Statement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxStatement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docx
 
Graded assign. inv. 3 4edit
Graded assign. inv. 3 4editGraded assign. inv. 3 4edit
Graded assign. inv. 3 4edit
 
Week 5 & 6 Query Project  Open the CUSTOMER file .docx
Week 5 & 6 Query Project    Open the CUSTOMER file  .docxWeek 5 & 6 Query Project    Open the CUSTOMER file  .docx
Week 5 & 6 Query Project  Open the CUSTOMER file .docx
 
Cte math test
Cte math testCte math test
Cte math test
 

Recently uploaded

PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)jennyeacort
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 

Recently uploaded (20)

Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
 
꧁❤ 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 ...
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 

portfolio for data analytics.pdf

  • 1. Question: Write a query that displays the order ID, account ID, and total dollar amount for all the orders, sorted first by the account ID (in ascending order), and then by the total amount (in descending order). Answer: Question: Pulls the first 5 rows and all columns from the orders table that have a dollar amount o f gloss_amt_usd greater than or equal to 1000. Answer:
  • 2. Question: Filter the accounts table to include the company name, website, and the primary point of contact (primary_poc) just for the Exxon Mobil company in the accounts table. Answer:
  • 3. Questions: Create a column that divides the standard_amt_usd by the standard_qty to find the unit price for standard paper for each order. Limit the results to the first 10 orders, and include the id and account_id fields. Answer: Question: All the companies whose names start with 'C'. Answer:
  • 4. Question: All companies whose names contain the string 'one' somewhere in the name. Answer: Question: All companies whose names end with 's'. Answer:
  • 5. Question: Use the web_events table to find all information regarding individuals who were contacted via the channel of organic or adwords. Answer: Question: Write a query that returns all the orders where the standard_qty is over 1000, the poster_qty is 0, and the gloss_qty is 0. Answer:
  • 6. Question: When you use the BETWEEN operator in SQL, do the results include the values of your endpoints, or not? Figure out the answer to this important question by writing a query that displays the order date and gloss_qty data for all orders where gloss_qty is between 24 and 29. Then look at your output to see if the BETWEEN operator included the begin and end values or not. Answer: Question: You will notice that using BETWEEN is tricky for dates! While BETWEEN is generally inclusive of endpoints, it assumes the time is at 00:00:00 (i.e. midnight) for dates. This is the reason why we set the right-side endpoint of the period at '2017-01-01'.
  • 7. Answer: Question: Write a query that returns a list of orders where the standard_qty is zero and either the gloss_qty or poster_qty is over 1000. Answer: Question: Find all the company names that start with a 'C' or 'W', and the primary contact contains 'ana' or 'Ana', but it doesn't contain 'eana'.
  • 8. Answer: Question: Try pulling standard_qty, gloss_qty, and poster_qty from the orders table, and the website and the primary_poc from the accounts table. Answer: ERD diagram:
  • 9. Question: Provide a table for all web_events associated with account name of Walmart. There should be three columns. Be sure to include the primary_poc, time of the event, and the channel for each event. Additionally, you might choose to add a fourth column to assure only Walmart events were chosen. Answer:
  • 10. Question: Provide the name for each region for every order, as well as the account name and the unit price they paid (total_amt_usd/total) for the order. Your final table should have 3 columns: region name, account name, and unit price. A few accounts have 0 for total, so I divided by (total + 0.01) to assure not dividing by zero. Answer: Question: Provide a table that provides the region for each sales_rep along with their associated accounts. This time only for accounts where the sales rep has a first name starting with S and in the Midwest region. Your final table should include three columns: the region name, the sales rep name, and the account name. Sort the accounts alphabetically (A-Z) according to account name.
  • 11. Answer: 1. Question: Provide the name for each region for every order, as well as the account name and the unit price they paid (total_amt_usd/total) for the order. However, you should only provide the results if the standard order quantity exceeds 100 and the poster order quantity exceeds 50. Your final table should have 3 columns: region name, account name, and unit price. Sort for the smallest unit price first. In order to avoid a division by zero error, adding .01 to the denominator here is helpful (total_amt_usd/(total+0.01). Answer:
  • 12. Question: What are the different channels used by account id 1001? Your final table should have only 2 columns: account name and the different channels. You can try SELECT DISTINCT to narrow down the results to only the unique values. Answer: Question: Find all the orders that occurred in 2015. Your final table should have 4 columns: occurred_at, account name, order total, and order total_amt_usd. Answer:
  • 13. Question: Find the total amount spent on standard_amt_usd and gloss_amt_usd paper for each order in the orders table. This should give a dollar amount for each order in the table. Answer: Question : Find the mean (AVERAGE) amount spent per order on each paper type, as well as the mean amount of each paper type purchased per order. Your final answer should have 6 values - one for each paper type for the average number of sales, as well as the average amount.
  • 14. Answer: Question: Who was the primary contact associated with the earliest web_event? Answer: Question: What was the smallest order placed by each account in terms of total usd. Provide only two columns - the account name and the total usd. Order from smallest dollar amounts to largest Answer:
  • 15. Question: Find the number of sales reps in each region. Your final table should have two columns - the region and the number of sales_reps. Order from fewest reps to most reps. Answer: Question: Determine the number of times a particular channel was used in the web_events table for each region. Your final table should have three columns - the region name, the channel, and the number of occurrences. Order your table with the highest number of occurrences first.
  • 16. Answer: Question : How many of the sales reps have more than 5 accounts that they manage? Answer: Question : How many accounts have more than 20 orders? Answer:
  • 17. Question: Which account has the most orders? Answer: Question : How many accounts spent more than 30,000 usd total across all orders? Answer :
  • 18. Question : How many accounts spent less than 1,000 usd total across all orders? Answer : Question : Which account has spent the most with us?
  • 19. Answer : Question : Which accounts used facebook as a channel to contact customers more than 6 times? Answer :
  • 20. Question : Which account used facebook most as a channel? Answer: Question : Which channel was most frequently used by most accounts? Answer :
  • 21. Question : Find the sales in terms of total dollars for all orders in each year, ordered from greatest to least. Do you notice any trends in the yearly sales totals? Answer : Question : In which month of which year did Walmart spend the most on gloss paper in terms of dollars? Answer:
  • 22. Question : We would now like to perform a similar calculation to the first, but we want to obtain the total amount spent by customers only in 2016 and 2017. Keep the same levels as in the previous question. Order with the top spending customers listed first. Answer : Question : The previous didn't account for the middle, nor the dollar amount associated with the sales. Management decides they want to see these characteristics represented as well. We would like to identify top performing sales reps, which are sales reps associated with more than 200 orders or more than 750000 in total sales. The middle group has any rep with more than 150 orders or 500000 in sales. Create a table with the sales rep name, the total number of orders, total sales across all orders, and a column with top, middle, or low depending on this criteria. Place the top sales people based on dollar amount of sales first in your final table. Answer :
  • 23. Question : Provide the name of the sales_rep in each region with the largest amount of total_amt_usd sales. Answer: First, I wanted to find the total_amt_usd totals associated with each sales rep, and I also wanted the region in which they were located. The query below provided this information. Next, I pulled the max for each region, and then we can use this to pull those rows in our final result.
  • 24. Essentially, this is a JOIN of these two tables, where the region and amount match.
  • 25. Question : How many accounts had more total purchases than the account name which has bought the most standard_qty paper throughout their lifetime as a customer? Answer : First, we want to find the account that had the most standard_qty paper. The query here pulls that account, as well as the total amount: Now, I want to use this to pull all the accounts with more total sales: This is now a list of all the accounts with more total orders. We can get the count with just another simple subquery.
  • 26. Question : For the customer that spent the most (in total over their lifetime as a customer) total_amt_usd, how many web_events did they have for each channel. Answer : Here, we first want to pull the customer with the most spent in lifetime value. Now, we want to look at the number of events on each channel this company had, which we can match with just the id.
  • 27. Question : What is the lifetime average amount spent in terms of total_amt_usd for the top 10 total spending accounts? Answer : First, we just want to find the top 10 accounts in terms of highest total_amt_usd. Now, we just want the average of these 10 amounts.
  • 28. Question : What is the lifetime average amount spent in terms of total_amt_usd, including only the companies that spent more per order, on average, than the average of all orders. Answer : First, we want to pull the average of all accounts in terms of total_amt_usd Then, we want to only pull the accounts with more than this average amount.
  • 29. Finally, we just want the average of these values Question : There are 350 company names that start with a letter and 1 that starts with a number. This gives a ratio of 350/351 that are company names that start with a letter or 99.7%. Answer :
  • 30. Question : There are 80 company names that start with a vowel and 271 that start with other characters. Therefore 80/351 are vowels or 22.8%. Therefore, 77.2% of company names do not start with vowels. Answer: Question : Use the accounts table to create first and last name columns that hold the first and last names for the primary_poc Answer :
  • 31. Question : We would also like to create an initial password, which they will change after their first log in. The first password will be the first letter of the primary_poc's first name (lowercase), then the last letter of their first name (lowercase), the first letter of their last name (lowercase), the last letter of their last name (lowercase), the number of letters in their first name, the number of letters in their last name, and then the name of the company they are working with, all capitalized with no spaces. Answer:
  • 32. Question : Use the NTILE functionality to divide the accounts into 4 levels in terms of the amount of standard_qty for their orders. Your resulting table should have the account_id, the occurred_at time for each order, the total amount of standard_qty paper purchased, and one of four levels in a standard_quartile column. Answer : Question : Use the NTILE functionality to divide the accounts into two levels in terms of the amount of gloss_qty for their orders. Your resulting table should have the account_id, the occurred_at time for each order, the total amount of gloss_qty paper purchased, and one of two levels in a gloss_half column. Answer :
  • 33. Question : What is the relationship between accounts.primary_poc and sales_reps.name? Answer: