Skip to content

Armita Kharmandar Assignment 1-1 (pdf) and 1-2 (sql) compeleted#1

Open
kharmandara wants to merge 1 commit intomainfrom
assignment-one
Open

Armita Kharmandar Assignment 1-1 (pdf) and 1-2 (sql) compeleted#1
kharmandara wants to merge 1 commit intomainfrom
assignment-one

Conversation

@kharmandara
Copy link
Copy Markdown
Owner

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

Answering assignment -1 (pdf) and 1-2 (sql)

What did you learn from the changes you have made?

how to query different tables and analyze them.

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

No.

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

opening the database in SQLite. but it came out an issue from the original file so the instructor fixed it and I pull the changes/ updated file and I was able to open the database.

How were these changes tested?

running the queries properly in SQLite.

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

Checklist

  • [Yes] 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!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The direction of relationship between vendor and customer-purchase look reversed. There should be one unique vendor_id in the vendor table, but many vendor_id in the customer_purchases table. Same case for the relationship between vendor and vendor_inventory table. And, for the second table, we don't indicate relationship between the same table 'booth'

SELECT product_id, product_name,

CASE
WHEN product_qty_type LIKE '%unit%'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This may classify any word containing "unit". Consider CASE WHEN product_qty_type = 'unit'

END AS prod_qty_type_condensed,

CASE
WHEN product_name LIKE '%pepper%'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LIKE '%pepper%' -- this will not match "Pepper" or "PEPPER". Consider using LOWER(...) LIKE '...'

SELECT vendor_id, COUNT(booth_number) as vendor_rent_time, booth_number

FROM vendor_booth_assignments
GROUP BY vendor_id, 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.

You may leave out the group by booth_umeber. Grouped by booth_number -- this output counts per booth, not per vendor.

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.

Please amend your assignment :)

@kharmandara
Copy link
Copy Markdown
Owner Author

Please amend your assignment :)

I am so sorry for late reply. I wonder if it is fine amending these feedbacks after finishing assignment 2 as I am a bit behind .

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