Skip to content

submitting sql assignment-two#2

Merged
davidancor merged 1 commit intomainfrom
assignment-two
Dec 2, 2025
Merged

submitting sql assignment-two#2
davidancor merged 1 commit intomainfrom
assignment-two

Conversation

@davidancor
Copy link
Owner

TITLE: UofT-DSI | SQL - Assignment 2

What changes are you trying to make?

I am adding 2 ERD PNGs for a book store logical model. 1 is without shifts and one is with shift. I am also uploading 1 .md file and 1 .sql file with answers to the required questions.

What did you learn from the changes you have made?

I learned that UPDATE/INSERT/DELETE don't show output. I had to add SELECT afterward to verify changes. I also learned that multiple SQL approaches can achieve the same result.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Yes, I considered using ROW_NUMBER() with SELECT DISTINCT instead of DENSE_RANK() with GROUP BY, but stuck with GROUP BY to match the class examples.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

The correlated UPDATE subquery was tricky, I had to combine ORDER BY with LIMIT 1 and remember COALESCE for null values.

How were these changes tested?

Ran SELECT statements before and after each change to verify the results.

A reference to a related issue in your repository (if applicable)

Checklist

  • [ x] I can confirm that my changes are working as intended

Copy link

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

Great work!

@monzchan
Copy link

monzchan commented Dec 2, 2025

@davidancor I found your Assignment 1 in the assignment branch, but since you haven’t created a PR for it, I am not able to review and comment formally. I’ll drop some comments here:

  1. WHERE: The line 'price' as [quantity * cost_to_customer_per_qty] will not calculate. This is the correct version: (quantity * cost_to_customer_per_qty) AS price
  2. CASE - Pepper flag: The assignment specifies regardless of capitalization, but LIKE in SQLite is case-sensitive. You may Use LOWER(product_name) LIKE '%pepper%'
  3. Temp Table - INSERT: Table is created as temp.new_vendor but insertion is to new_vendor (missing temp.).

Note: Assignments will not be graded if no PR is created. I made an exception this time, but please make sure to open a PR for each branch you create for each assignment.

@davidancor davidancor merged commit f3c4bfe into main Dec 2, 2025
1 check passed
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