Skip to content

UofT-DSI | SQL - Assignment 2 - #2

Open
ruokun-ai wants to merge 3 commits into
mainfrom
assignment-two
Open

UofT-DSI | SQL - Assignment 2#2
ruokun-ai wants to merge 3 commits into
mainfrom
assignment-two

Conversation

@ruokun-ai

Copy link
Copy Markdown
Owner

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

  • I can confirm that my changes are working as intended

ruokun-ai added 3 commits May 11, 2026 03:41
Added explanations for Type 1 and Type 2 slowly changing dimensions, including their designs and column details.

@niyazmnazari niyazmnazari left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for submitting assignment 2. All tasks are complete and correct.
Mark: 70/70

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