Open
Conversation
Reviewer's Guide by SourceryThis pull request completes the second assignment by adding SQL queries for various tasks, including window functions, string manipulations, unions, cross joins, inserts, deletes, and updates. ER diagram for product_units table creation and modificationerDiagram
product ||--o{ product_units : "snapshot"
product {
int product_id
string product_name
string product_size
int product_category_id
string product_qty_type
}
product_units {
int product_id
string product_name
string product_size
int product_category_id
string product_qty_type
timestamp snapshot_timestamp
int current_quantity
}
ER diagram for Type 1 vs Type 2 customer address storageerDiagram
%% Type 1 Approach
CUSTOMER_TYPE1 ||--|| ADDRESS_TYPE1 : has
CUSTOMER_TYPE1 {
int customer_id
string name
string current_address
}
ADDRESS_TYPE1 {
string address
timestamp last_updated
}
%% Type 2 Approach
CUSTOMER_TYPE2 ||--o{ ADDRESS_TYPE2 : has
CUSTOMER_TYPE2 {
int customer_id
string name
}
ADDRESS_TYPE2 {
int address_id
int customer_id
string address
date valid_from
date valid_to
boolean is_current
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @brtivedi5 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider maintaining consistent SQL formatting throughout - use proper indentation and line breaks to make queries more readable.
- Add more inline comments to explain the logic in complex queries, particularly in the cross join and window function sections.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| Your answer... | ||
| ``` | ||
|
|
||
| Type 1: Overwrite the data . ( Only the latest address will be retained per customer) |
There was a problem hiding this comment.
issue (typo): Typo: Remove period after "data".
There should not be a period after the word "data".
Suggested change
| Type 1: Overwrite the data . ( Only the latest address will be retained per customer) | |
| Type 1: Overwrite the data ( Only the latest address will be retained per customer) |
|
|
||
| Type 1: Overwrite the data . ( Only the latest address will be retained per customer) | ||
|
|
||
| Type 2: Retain historical data (All the address will be retained per customer as a new address record is created for each address change) |
There was a problem hiding this comment.
issue (typo): Typo: "All the address" should be "All addresses".
The correct phrasing is "All addresses".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Changed Delete Q1 and type1 and type 2 explanation added
What did you learn from the changes you have made?
Make sure to commit as required
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
No
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
None
How were these changes tested?
I tested via inbuild test
A reference to a related issue in your repository (if applicable)
NA
Checklist
Summary by Sourcery
Update queries for Assignment 2 and add an explanation of Type 1 and Type 2 slowly changing dimensions.
New Features:
Enhancements:
Tests: