Skip to content
This repository was archived by the owner on Aug 17, 2024. It is now read-only.

NW5 Manchester - Doris Siu - SQL - Week 2 - #186

Open
Doris-Siu wants to merge 2 commits into
CodeYourFuture:mainfrom
Doris-Siu:main
Open

NW5 Manchester - Doris Siu - SQL - Week 2#186
Doris-Siu wants to merge 2 commits into
CodeYourFuture:mainfrom
Doris-Siu:main

Conversation

@Doris-Siu

Copy link
Copy Markdown

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name:
  • Your City:
  • Your Slack Name:

Homework Details

  • Module:
  • Week:

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?

Comment thread .gitignore
@@ -0,0 +1 @@
node_modules

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 remembered to add node_modules to your .gitignore file, good job

Comment thread 2-exercises/task.md
To submit this homework write the correct commands for each question here:

```sql
1. select name, address from customers where country = 'United States';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

using uppercase for your SQL commands can make it easier to read :)

Comment thread 2-exercises/task.md
```sql
1. select name, address from customers where country = 'United States';
2. select * from customers order by name;
3. select * from products where product_name ilike 'socks%' or product_name ilike '%socks' or product_name ilike '%socks%';

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 can just use %socks% here

Comment thread 2-exercises/task.md
5. select * from product_availability order by unit_price desc limit 5;
6. select p.product_name, pa.unit_price, s.supplier_name from products p join product_availability pa on (p.id=pa.prod_id) join suppliers s on (s.id=pa.supp_id);
7. select p.product_name, s.supplier_name from products p join product_availability pa on (p.id=pa.prod_id) join suppliers s on (s.id=pa.supp_id) where s.country = 'United Kingdom';
8. select oi.order_id, o.order_reference, o.order_date, (oi.quantity * pa.unit_price) as total_cost

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like how you're using AS total_cost here

Comment thread 2-exercises/task.md
on (pa.prod_id = p.id)
where o.order_reference = 'ORD006';
11. select c.name, o.order_date, o.order_reference, p.product_name, s.supplier_name, oi.quantity
from customers c

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

splitting your clauses over new lines make it easier to follow, nice job :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants