Code Monkey home page Code Monkey logo

sql-scratch-capstone-turn-in's Introduction

sql-scratch-capstone-turn-in

This was my final project for the Codecademy SQL bootcamp.

sql-scratch-capstone-turn-in's People

Contributors

nekonotsuchi avatar

Watchers

 avatar

sql-scratch-capstone-turn-in's Issues

Summary

Rubric Score

Criteria 1: Report

  • Score Level: 4 (Exceeds Expectations)
  • Comment(s): Every answer has three components: 1) SQL queries, 2) output tables as evidence, 3) text interpreting the query results. Your supporting text was very thorough, though I wished it did a little more personal reinterpretation rather than restating the table contents.

Criteria 2: Query Accuracy

  • Score Level: 4 (Exceeds Expectations)
  • Comment(s): Most queries are accurate. However, we were seeking you to use to COUNT() function in the first question asking how many campaigns/sources there are: note.

Criteria 3: Query Formatting

Criteria 4: Understanding underlying concepts and terminology

  • Score Level: 4 (Exceeds Expectations)
  • Comment(s): Report demonstrates a solid understanding of funnels. You correctly understand the distinction between different touch methods and how they may drive not only visits, but also purchases. You provided good recommendations based on the purchase rates.

Overall Score: 15/16

Overall, very good job! Your presentation is very well made and demonstrates a clear understanding of how the SQL tables relate to real-world business problems. One area of improvement is to include renamed columns and table aliases to improve readability. But otherwise, you did a great job grasping the importance of both campaign types and conversion rates. Well done!

Looking for *number* of campaigns and sources

1. How many campaigns and sources does CoolTShirts use? Which source is used for each campaign? SELECT DISTINCT(utm_source) FROM page_visits; SELECT DISTINCT(utm_campaign) FROM page_visits; SELECT DISTINCT utm_source, utm_campaign FROM page_visits;

Good work pulling out the distinct sources and campaigns. However, we wanted you to count how many campaigns and sources there were. You can do so with the COUNT() command:

SELECT COUNT(DISTINCT utm_source)
FROM page_visits;
SELECT COUNT(DISTINCT utm_campaign)
FROM page_visits;

Readable column names

3. How many first touches is each campaign responsible for? WITH first_touch AS (SELECT user_id, MIN(timestamp) as first_touch_at FROM page_visits GROUP BY user_id), ft_attr AS (SELECT ft.user_id, ft.first_touch_at, pv.utm_source, pv.utm_campaign FROM first_touch ft JOIN page_visits pv ON ft.user_id = pv.user_id AND ft.first_touch_at = pv.timestamp) SELECT ft_attr.utm_source, ft_attr.utm_campaign, COUNT(*) FROM ft_attr GROUP BY 1, 2 ORDER BY 3 DESC;

It's a good idea to rename columns to make the table more readable, especially when you are pulling data from multiple sources or using aggregate commands (like COUNT()). The syntax for renaming a column is:
SELECT original_column_name AS 'new_column_name'

Here you could it apply it with:

SELECT ft_attr.utm_source AS 'Source',
       ft_attr.utm_campaign AS 'Campign',
       COUNT(*) AS 'Number of First Touch'
FROM ft_attr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.