Skip to content

Assignment two completed#2

Open
Sunowlay wants to merge 1 commit intomainfrom
Assignment-two
Open

Assignment two completed#2
Sunowlay wants to merge 1 commit intomainfrom
Assignment-two

Conversation

@Sunowlay
Copy link
Copy Markdown
Owner

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

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
Copy Markdown

@monzchan monzchan left a comment

Choose a reason for hiding this comment

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

Excellent work!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please indicate the relationship

How many customers are there (y).
Before your final group by you should have the product of those two queries (x*y). */

SELECT
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You may consider using DISTINCT query to avoid duplicate rows if customer_id has multiple purchases on the same day


INSERT INTO product_units
(product_id, product_name, product_size, product_category_id, product_qty_type, snapshot_timestamp)
VALUES (999, 'Apple Pie', '500g', 5, 'unit', CURRENT_TIMESTAMP);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

here inserts product_id = 999 manually. Could consider auto-increment / calculating MAX(product_id)+1 to avoid conflicts

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