Skip to content

Assignment one#1

Open
jay-ramani wants to merge 3 commits intomainfrom
assignment-one
Open

Assignment one#1
jay-ramani wants to merge 3 commits intomainfrom
assignment-one

Conversation

@jay-ramani
Copy link
Copy Markdown
Owner

UofT-DSI | sql - Assignment 1

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

Checking in the solutions for SQL queries to Assignment 1

What did you learn from the changes you have made?

I learnt how to write SQL queries using SELECT, WHERE, JOIN, HAVING etc.

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

No other approaches

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

I faced challenges in joining and combining others SQL commands with queries. I overcame the challenges by re-visiting the recorded training sessions and third-party videos on YouTube.

How were these changes tested?

By executing the SQL commands in DB Browser for SQLite

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

N/A

Checklist

  • I can confirm that my changes are working as intended

Copy link
Copy Markdown

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


FROM customer_purchases

WHERE product_id = 4 AND product_id = 9;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

product_id cannot be 4 and 9 at the same time. consider BETWEEN

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Hi Moniz,

The problem statement specifically states customer purchases of product ids 4 and 9 (please see the problem statement quoted below). How can it be between 4 and 9?

"1. Write a query that returns all customer purchases of product IDs 4 and 9"

Comment thread 02_activities/assignments/Cohort_8/assignment1.sql
FROM vendor, vendor_booth_assignments

WHERE vendor.vendor_id = vendor_booth_assignments.vendor_id
GROUP by vendor.vendor_id, vendor_booth_assignments.booth_number;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Grouping by booth_number is unnecessary and will produce multiple rows per vendor.

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