UofT-DSI | SQL - Assignment 2 - #2
Open
ruokun-ai wants to merge 3 commits into
Open
Conversation
Added explanations for Type 1 and Type 2 slowly changing dimensions, including their designs and column details.
niyazmnazari
approved these changes
May 12, 2026
niyazmnazari
left a comment
There was a problem hiding this comment.
Thank you for submitting assignment 2. All tasks are complete and correct.
Mark: 70/70
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)
I completed the all sections for Assignment 2, including ERD, string manipulation, COALESCE, window functions, UNION, CROSS JOIN, INSERT, DELETE, and UPDATE statements.
What did you learn from the changes you have made?
I learned how to use SQL to clean and transform data, handle NULL values, rank and count records with window functions, combine query results with UNION, generate combinations with CROSS JOIN, and modify tables using INSERT, DELETE, ALTER TABLE, and UPDATE.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
Yes. For some queries, I considered using temporary tables or CTEs to break the logic into smaller steps. For the window function questions, I also compared using ROW_NUMBER() versus DENSE_RANK() depending on whether the query returned unique visit dates or all purchase rows.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
For the DELETE statement, I initially considered removing the older record by finding the smallest snapshot_timestamp value. However, because the timestamps could be identical when rows were inserted within the same second, I instead used the SQLite rowid to reliably identify and keep the most recently inserted row.
How were these changes tested?
I tested the queries in DB Browser for SQLite by running each query individually and reviewing the output. I checked that filters, rankings, counts, inserted rows, deleted rows, and updated values matched the assignment requirements.
A reference to a related issue in your repository (if applicable)
N/A
Checklist