Tag Archives: Business Analytics Nanodegree Udacity

Quiz – Subqueries & Temporary Tables

Provide the name of the sales_rep in each region with the largest amount of total_amt_usd sales. Step 1 – Get the MAX total_amt_usd per region: regionname totalamt Midwest 48675.90 Southeast 95005.82 Northeast 93106.81 West 232207.07 I get the max amt_usd per region, but how do I get the … Continue reading

Posted in Study Notes | Tagged | Leave a comment

Subquery Example Challenge

Quiz What is the top channel used by each account to market products? How often was that same channel used? However, we will need to do two aggregations and two subqueries to make this happen. Let’s find the number of times each … Continue reading

Posted in Study Notes | Tagged | Leave a comment

SQL Subqueries: Dependencies

Simple the inner subquery is completely independent from the outer query Correlated the inner subquery is dependent on a clause in the outer query The second concept to consider before writing any code is the dependency of your subquery to … Continue reading

Posted in Study Notes | Tagged | Leave a comment

Subquery Examples

Inline Subquery creates a table that you could then query again in the FROM statement Expert Tip Note that you should not include an alias when you write a subquery in a conditional statement. This is because the subquery is treated as … Continue reading

Posted in Study Notes | Tagged | Leave a comment

SQL Subquery Formatting

The first concept that helps when thinking about the format of a subquery is the placement of it: with, nested, inline, or scalar. The second concept to consider is an indentation, which helps heighten readability for your future self or … Continue reading

Posted in Study Notes | Tagged | Leave a comment

SQL Placements

Nested query within another query embedded within the WHERE clause when a user wants to filter an output using a condition met from another table advantageous for readability Use Case for a Nested Subquery When a user wants to filter an … Continue reading

Posted in Study Notes | Tagged | Leave a comment

Study Notes #22

SQL Subqueries & Temporary Tables Subquery a query within a query a query has both SELECT and FROM clauses to signify what you want to extract from a table and what table you’d like to pull data from. A query that includes subquery, as … Continue reading

Posted in Study Notes | Tagged | Leave a comment

Study Notes #21

SQL GROUP BY allows creating segments that will aggregate independent from one another allows to take the sum of data limited to each account rather than across the entire dataset goes in between the WHERE and ORDER clause you should … Continue reading

Posted in Study Notes | Tagged | Leave a comment

Study Notes #20

SQL AND and BETWEEN Quiz 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. Using the accounts table, find all the companies whose names do not start with ‘C’ and end with ‘s’. When you use … Continue reading

Posted in Study Notes | Tagged | Leave a comment

Study Notes #19

I am not sure how I missed this module. 😞 Basic SQL primary_poc – a column name on the diagram above web_events – a table name on the diagram above Database – a collection of tables that share connected data … Continue reading

Posted in Study Notes | Tagged | Leave a comment