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
Open
Conversation
Nomes27
reviewed
Feb 27, 2023
| @@ -0,0 +1 @@ | |||
| node_modules | |||
There was a problem hiding this comment.
you remembered to add node_modules to your .gitignore file, good job
Nomes27
reviewed
Feb 27, 2023
| To submit this homework write the correct commands for each question here: | ||
|
|
||
| ```sql | ||
| 1. select name, address from customers where country = 'United States'; |
There was a problem hiding this comment.
using uppercase for your SQL commands can make it easier to read :)
Nomes27
reviewed
Feb 27, 2023
| ```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%'; |
Nomes27
reviewed
Feb 27, 2023
| 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.
I like how you're using AS total_cost here
Nomes27
reviewed
Feb 27, 2023
| 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.
splitting your clauses over new lines make it easier to follow, nice job :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in
HOW_TO_MARK.mdin 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?