Skip to content

Assignment two#2

Open
AnthoniaAina wants to merge 2 commits intomainfrom
assignment-two
Open

Assignment two#2
AnthoniaAina wants to merge 2 commits intomainfrom
assignment-two

Conversation

@AnthoniaAina
Copy link
Owner

@AnthoniaAina AnthoniaAina commented Nov 17, 2025

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

submitted assignment two

What did you learn from the changes you have made?

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

How were these changes tested?

A reference to a related issue in your repository (if applicable)

Checklist

  • I can confirm that my changes are working as intended

Copy link

@anjali-deshpande-hub anjali-deshpande-hub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! (63/70)

Review comments:
Section 1: The ERD should also have the cardinality drawn with the arrows (1 - ∞, ∞ - ∞, 1-1 etc)
Section 2 Question 1 Window function - SELECT query inside FROM wasn't required. You could simply use

GROUP BY customer_id, market_date
ORDER BY customer_id, market_date

Section 3 Question 3 Count (): The Count function used has no argument. The correct query is

SELECT cp.*,
COUNT(product_id) OVER (PARTITION BY customer_id, product_id) AS
product_purchase_count
FROM customer_purchases AS cp
ORDER BY customer_id, product_id, market_date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants