LONDON_10 || SAIM KORKMAZ || Big-Spender SQL Week-2 - #114
Open
nsaimk wants to merge 17 commits into
Open
Conversation
sherif98
reviewed
Sep 16, 2023
sherif98
left a comment
There was a problem hiding this comment.
A small nit and it highly depends on personal taste, but in general, people tend to use upper case letters in the SQL commands they're using.
For example:
SELECT * FROM products WHERE product_name ILIKE '%socks%';
|
|
||
| ```sql | ||
| INSERT YOUR QUERY HERE | ||
| select spends.* from spends join expense_areas on spends.expense_area_id = expense_areas.id where expense_areas.expense_area like 'Better Hospital Food'; |
There was a problem hiding this comment.
Since you're looking for a specific text, you don't need to use LIKE command. It's better to just use = here
| ```sql | ||
| INSERT YOUR QUERIES HERE | ||
|
|
||
| insert into spends(date, amount, description, transaction_no, supplier_inv_no, supplier_id, expense_type_id, expense_area_id) values ('2021-08-19', 32000, 'Computer Hardware Dell', 38104091, 3780119655, 66, 42, 46); |
There was a problem hiding this comment.
I'd add the other queries you used to create the records with IDs 66, 42, and 46.
kwebster77
reviewed
Sep 16, 2023
|
|
||
| ```sql | ||
| CREATE YOUR QUERY HERE | ||
| select date_trunc('month', date), sum(amount) from spends group by date_trunc('month', date); |
There was a problem hiding this comment.
good use of data_trunc, but what would you do if there were different years?
|
Kudos, SonarCloud Quality Gate passed! |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.








Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.