Code Monkey home page Code Monkey logo

8-week-sql-challenge's Introduction

๐Ÿ™‹๐Ÿปโ€โ™€๏ธ Introducing Myself

Brown and Gray Simple Personal LinkedIn Banner

Hello, I'm Katie. Data Analyst with expertise in data analysis and reporting, query optimization, database design, and data modelling.

  • Querying data using SQL.
  • Generate reports and perform ad-hoc data analysis using SQL.
  • Developing dashboards on Tableau and Looker Studio.
  • Data analysis and reporting using Google Sheets and Excel.

๐Ÿ“š Projects

Welcome to my portfolio, where I showcase my projects.

๐Ÿ› ๏ธ Tools

  • Language: SQL, Python
  • Database: Google BigQuery, PostgreSQL, MySQL
  • Visualization: Tableau, Looker Studio

๐Ÿ‘‹๐Ÿป Connect with Me

8-week-sql-challenge's People

Contributors

katiehuangx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

8-week-sql-challenge's Issues

Data Mart: Data Cleansing, Step 2.

Hi there Katie, I have been using your solutions as my reference, thank you for the effort you invested in all of this challenge.
I'd like to remind you that you may have forgotten to be inclusive of the fact that in step 2 of the cleansing process, you ought to make sure that each year week 1 must contain the dates 1st Jan - 7th Jan, week 2 must contain the dates 8th Jan - 14th Jan, and so on. With the code as it is, with the default start weekday in sql as 7 (Sunday), your week 1 in 2018 will contain dates 1st Jan - 6th Jan, and week 2 will contain dates 7th Jan - 13th Jan, and the rest of the week numbers to be misrepresented and inaccurate, which may mess up the entire analysis. Therefore you'll have to adjust for that in your code and everything will be good, BE mindful of the fact that 2018 has 53 weeks in it, the other years 52 weeks. You can adjust it with something like the code below in the attached file, replace 'date_missing' with 'week_date'(already converted into the proper datatype)
Screenshot 2023-08-10 134909

In Case Study #1: Danny's Diner it should be using row_number instead of dense_rank in below question due to which 2 products are displayed because of dense_rank

@katiehuangx --3. What was the first item from the menu purchased by each customer?
WITH ordered_sales_cte AS
##(
SELECT
customer_id,
order_date,
product_name,
row_number() OVER(PARTITION BY s.customer_id ORDER BY s.order_date) AS rank
FROM dbo.sales AS s
JOIN dbo.menu AS m
ON s.product_id = m.product_id
)

SELECT
customer_id,
product_name
FROM ordered_sales_cte
WHERE rank = 1
GROUP BY customer_id, product_name;

--Using dense_rank:
image

--Using row_number(correct one):
image

Data Mart : Part C before and after analysis

Using the week_number to filter out the dates would result in incorrect analysis. A simple query will show that week_number shift in 2020.

image

Hence it is better to use date_add, date_sub and interval to filter out the correct dates.

Pizza Runner A 10

I think your code was wrong, simply look up 01/01/2020 was Wednesday and your result doesn't have it.

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.