Skip to content

UofT-DSI | SQL - Assignment 1#1

Open
francesbruno wants to merge 2 commits intomainfrom
Assignment-one
Open

UofT-DSI | SQL - Assignment 1#1
francesbruno wants to merge 2 commits intomainfrom
Assignment-one

Conversation

@francesbruno
Copy link
Copy Markdown
Owner

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

Creating a logical data model for two related tables in the farmers market database, completing all required SQL queries in assignment1.sql using SQLite (i.e., filtering, conditional logic, joins, aggregation, temporary table), and completing Section 4 in markdown file: reflections on ethics in using and designign databases and data systems.

What did you learn from the changes you have made?

Practiced using SQLite and to write and organize queries such as SELECT, WHERE, CASE, INNER JOIN, GROUP BY, HAVING, temporary tables.

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

Using slightly different syntax, such as using AND instead of BETWEEN for range filtering, and selecting specific columns instead of *. For the logical model, I also considered diagramming a different pair of related tables, but I chose customer and customer_purchases because their one-to-many relationship was straightforward.

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

Working with temporary tables ...re-running the same code caused an error when the temp table already existed.

How were these changes tested?

After googling I resolved this by checking my work carefully against the prompt, testing each query in the database, and using DROP TABLE IF EXISTS during testing.

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

Checklist

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

francesbruno and others added 2 commits March 31, 2026 01:08
Copy link
Copy Markdown

@anjali-deshpande-hub anjali-deshpande-hub left a comment

Choose a reason for hiding this comment

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

Well done! 30/30

c.customer_id,
c.customer_last_name,
c.customer_first_name
HAVING SUM(cp.quantity * cp.cost_to_customer_per_qty) > 2000
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instead of recalculating, you can directly use total_spent > 2000

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