Skip to content

added-assignment-2#2

Open
ashwinder1 wants to merge 5 commits intomainfrom
assignment-two
Open

added-assignment-2#2
ashwinder1 wants to merge 5 commits intomainfrom
assignment-two

Conversation

@ashwinder1
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.

Employee's shift table is missing.
And, please complete prompt 3 and also assignment2.sql

@ashwinder1
Copy link
Copy Markdown
Owner Author

Hey @monzchan,
Thanks for your comment. Sorry, I'm still working on this and will finish by tomorrow.

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.

Please complete the remaining parts of the assignment :)


-- second query
SELECT
MAX(market_date),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For “most recent visit,” you may consider filtering WHERE visit_number = 1, instead of using MAX(market_date) + GROUP BY. The result may not be exactly correct if a customer has multiple visits on the same date since MAX(market_date) won't capture ties correctly

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Great suggestion! that makes sense. Thanks!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The diagram looks great!

@ashwinder1
Copy link
Copy Markdown
Owner Author

Please complete the remaining parts of the assignment :)

Yes working on it.

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! Just some minor comments for improvement:)


SELECT *
, CASE
WHEN INSTR(product_name, '-') THEN TRIM(SUBSTR(product_name, INSTR(product_name, '-') + 1))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

INSTR returns an integer, so here may throw an error
consider WHEN INSTR(product_name, '-') >0

ADD COLUMN current_quantity INTEGER;

WITH Latest_Qty AS (
SELECT product_id, max(market_date), quantity
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the quantity may not matches the max(market_date) row. Consider ROW_NUMBER() here

@ashwinder1
Copy link
Copy Markdown
Owner Author

ashwinder1 commented Aug 21, 2025

Excellent work! Just some minor comments for improvement:)

Great points. Will work on them. Thanks for the valuable comments!

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