-
-
Notifications
You must be signed in to change notification settings - Fork 218
NW5 Manchester - Doris Siu - SQL - Week 2 #186
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1 @@ | |||
node_modules |
There was a problem hiding this comment.
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
```sql | ||
1. select name, address from customers where country = 'United States'; |
There was a problem hiding this comment.
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 :)
```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%'; |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
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 :)
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 repositoryYour Details
Homework Details
Notes
What did you find easy?
What did you find hard?
What do you still not understand?
Any other notes?