Skip to content

UofT-DSI | SQL - Assignment 1#1

Open
sumitgiri87 wants to merge 123 commits intosumitgiri87:assignment-onefrom
UofT-DSI:main
Open

UofT-DSI | SQL - Assignment 1#1
sumitgiri87 wants to merge 123 commits intosumitgiri87:assignment-onefrom
UofT-DSI:main

Conversation

@sumitgiri87
Copy link
Copy Markdown
Owner

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

I have added the logical data model (Assignment_1_logical_data_model) for two connected tables (customer and customer_purchases) in the farmersmarket.db dataset, along with a SQL script (assignment1.sql) containing solutions for SELECT, WHERE, CASE, JOIN, AGGREGATE, TEMP TABLE, and DATE queries as outlined in the assignment.

What did you learn from the changes you have made?

I learned how to explore a SQLite database schema, identify table relationships, and create an ERD that visually represents a one-to-many relationship. I also reinforced my understanding of SQL syntax for filtering, joining, aggregation, conditional expressions, and date functions.

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

I considered diagramming vendor and vendor_booth_assignments, but decided customer and customer_purchases were more intuitive for demonstrating relationships and query logic.

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

The main challenge was identifying relationships without explicit foreign key constraints. I overcame this by examining column names and sample data in DB Browser for SQLite. Another challenge was remembering that SQLite’s STRFTIME function returns strings, which required adjusting my WHERE filters accordingly.

How were these changes tested?

I ran all SQL queries in DB Browser for SQLite against the farmersmarket.db file to ensure they returned correct results. I verified the ERD by cross-checking the relationship in the database schema and sample data.

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

N/A

Checklist

  • I can confirm that my changes are working as intended

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.

6 participants