-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NW6 | Hadika Malik | Module-Database | Big-spender | Week 2 #167
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
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.
Great work overall! A little more work needed on the table insertions + attention to the minor details in requirements.
@@ -68,39 +68,48 @@ INSERT YOUR QUERY HERE | |||
**You:** Then here's the query for that: | |||
|
|||
```sql | |||
INSERT YOUR QUERY HERE | |||
select * from spends where description ilike '%fee%'; |
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.
Good work taking the capitlisations into consideration with 'ilike'
select s.* | ||
from spends s | ||
join expense_areas ea on s.expense_area_id = ea.id | ||
where ea.expense_area ilike 'Better Hospital Food'; |
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.
Good use of joins!
``` | ||
|
||
**Claire:** Great, that's very helpful. How about the total amount spent for each month? | ||
|
||
**You:** You can get that by using the GROUP BY clause. Here's the query: | ||
|
||
```sql | ||
CREATE YOUR QUERY HERE | ||
select to_char(date,'YYYY-MM') as month from spends group by month; |
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.
Good attempt and nice formatting of the date, however you have partially answered the question. Only one column is returned, but two are expected in your results. Which column is missing?
``` | ||
|
||
**Farnoosh:** Oh, how do I know who these suppliers are? There's only numbers here. | ||
|
||
**You:** Whoops! I gave you ids to key the totals, but let me give you names instead. | ||
|
||
```sql | ||
INSERT YOUR QUERY HERE | ||
select sp.amount, sup.supplier |
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.
The question is for the total amount spent by each supplier. Which operator missing here is needed to get the desired result?
'3780119655', | ||
'Computer Hardware Dell', | ||
32000 | ||
); |
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.
Good attempt here. The rows ' Dell', 'Hardware' and 'IT' are missing from other tables, what extra step is needed to have the rows populated where necessary? What effect will this change have on the 'id's inserted in spends table?
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
I have completed the big-spender ticket.
Questions
Ask any questions you have for your reviewer.