Open
Conversation
… branch, now renamed to assignment-two-archieve
… as assignment-two-archieve, this is the corrected branch
kelichiu
reviewed
Feb 2, 2025
kelichiu
left a comment
There was a problem hiding this comment.
Total Point: 60/70
Section 1: 44/46
- TYPE 1 & TYPE 2: A table can not contain both type 1 & type 2 records at the same time. Type 1 / Type 2 refer to the design of a Table, not addresses.
Section 2: 6/8
- WINDOW FUNCTION Q1: When use ROW_NUMBER, the data of customer_id and market_date is not unique. We need to use GROUP BY to get the unique combination of customer_id and market_date in data.
Section 3: 2/8
- INSERT: snapshot_timestamp column should be created when creating the product_units table. Having it created with ALTER statement afterwards resulted in NULLs for existing records.
- DELETE: It’s correct to use both product_id and snapshot_timestamp to delete the record. However, the condition “snapshot_timestamp IS NULL” is not correct, as you shouldn’t have NULL values in this column in the first place.
- UPDATE: The subquery inside COALESCE is not correctly written. This resulted in NULL values not being handled in the final result.
Section 4: 8/8
Owner
Author
Hi Keli, Hope you are doing well! Can I ask for the outputs on your end to see what’s actually wrong? Especially for the update statement since it is working perfectly fine on my end — thanks! |
|
INSERT output: snapshot_timestamp doesn't have NULL values
[image: Screen Shot 2025-02-02 at 5.52.38 PM.png]
UPDATE output: current_quantity doesn't have NULL values, they are turned
into 0.
[image: Screen Shot 2025-02-02 at 5.54.05 PM.png]
…On Sun, Feb 2, 2025 at 4:27 PM eceyucer ***@***.***> wrote:
Total Point: 60/70 Section 1: 44/46
- TYPE 1 & TYPE 2: A table can not contain both type 1 & type 2
records at the same time. Type 1 / Type 2 refer to the design of a Table,
not addresses.
Section 2: 6/8
- WINDOW FUNCTION Q1: When use ROW_NUMBER, the data of customer_id and
market_date is not unique. We need to use GROUP BY to get the unique
combination of customer_id and market_date in data.
Section 3: 2/8
- INSERT: snapshot_timestamp column should be created when creating
the product_units table. Having it created with ALTER statement afterwards
resulted in NULLs for existing records.
- DELETE: It’s correct to use both product_id and snapshot_timestamp
to delete the record. However, the condition “snapshot_timestamp IS NULL”
is not correct, as you shouldn’t have NULL values in this column in the
first place.
- UPDATE: The subquery inside COALESCE is not correctly written. This
resulted in NULL values not being handled in the final result.
Section 4: 8/8
Hi Keli,
Hope you are doing well! Can I ask for the outputs on your end to see
what’s actually wrong? Especially for the update statement since it is
working perfectly fine on my end — thanks!
—
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5DRMACYIZWNADCENQKPFL2N2ETVAVCNFSM6AAAAABWIO6WACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRZGU3DCOBTGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
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)
Added code to assignment2.sql to complete the assignment, familiarizing myself with coalesce, window functions such as row_number and rank, string manipulations, and updating data tables. Completed sections 1 and 4.
What did you learn from the changes you have made?
Designing a database from scratch in Section 1, practicing new SQL knowledge on coalesce, window functions such as row_number and rank, string manipulations, updating data tables in Sections 2 and 3, and considering the nuances of ethics of automatization models.
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?
I did not realize that I was in the assignment-one branch when I created my assignment-two branch on the terminal. I opened a pull request and noticed that all my commits for assignment-one were also appearing. As a result, I first renamed the original assignment-two branch, accidentally committed assignment-one related changes once again, deleted the first branch and renamed the second attempt as assignment-two-archieve. The current branch only has assignment-two related commits.
How were these changes tested?
By running the SQL code on SQLite.
A reference to a related issue in your repository (if applicable)
N/A
Checklist