Skip to content

LONDON_10 || SAIM KORKMAZ || Big-Spender SQL Week-2 - #114

Open
nsaimk wants to merge 17 commits into
CodeYourFuture:mainfrom
nsaimk:main
Open

LONDON_10 || SAIM KORKMAZ || Big-Spender SQL Week-2#114
nsaimk wants to merge 17 commits into
CodeYourFuture:mainfrom
nsaimk:main

Conversation

@nsaimk

@nsaimk nsaimk commented Sep 11, 2023

Copy link
Copy Markdown

Learners, PR Template

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 follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@sherif98 sherif98 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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%';

Comment thread Big-Spender/readme.md

```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';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since you're looking for a specific text, you don't need to use LIKE command. It's better to just use = here

Comment thread Big-Spender/readme.md
```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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd add the other queries you used to create the records with IDs 66, 42, and 46.

Comment thread Big-Spender/readme.md

```sql
CREATE YOUR QUERY HERE
select date_trunc('month', date), sum(amount) from spends group by date_trunc('month', date);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good use of data_trunc, but what would you do if there were different years?

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants