Skip to content
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 | Pedro Ricciardi | Databases Module | [TECH ED] Big Spender | Sprint 2 #158

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PERicci
Copy link

@PERicci PERicci commented May 16, 2024

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes meet the requirements of this task

Changelist

All queries were written using SQL based on user stories and tested on the local database.

Issue

[TECH ED] Big Spender

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

@sayoiscool sayoiscool left a comment

Choose a reason for hiding this comment

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

Overall, great work and good understanding of database queries, however, a little more work to be done with the row insertions

select s.*
from spends s
join expense_areas ea on s.expense_area_id = ea.id
where ea.expense_area ilike 'Better Hospital Food';
```

Choose a reason for hiding this comment

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

great job showing alternative queries for this request!

to_char(date_trunc('month', date), 'Month') as month,
sum(amount) as total_amount
from spends
group by month;
```

Choose a reason for hiding this comment

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

nice work with the date formatting. the date is presented in a clear and easily readable format for the result.

from spends
where
date = '2021-03-01' or
date = '2021-04-01'

Choose a reason for hiding this comment

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

good work. also think of another sql function that would be useful in this case. what sql operator would allow you to specify multiple values in the where clause?

(select id from expense_types
where expense_type ilike 'Hardware'),
(select id from expense_areas
where expense_area ilike 'IT')

Choose a reason for hiding this comment

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

The rows 'hardware', ' dell' and 'IT' don't exist in the other tables, what extra step is needed to populate them where necessary?

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