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

databases week1/farzaneh #145

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

Conversation

FarzanehAhmadi
Copy link
Collaborator

No description provided.

Copy link

@josejfernandez josejfernandez left a comment

Choose a reason for hiding this comment

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

Hey Farzaneh, nicely done! I checked all the statements and they worked correctly. I left two comments with suggestions, but nothing major that blocks the review. Good job!

I have noticed that my review does not allow you to merge - I have requested access to fix this.

-- Result: 35

-- 2. Find out how many tasks in the task table do not have a valid due date
select COUNT(id) from task

Choose a reason for hiding this comment

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

I have noticed inconsistent casing in the different statements: Select in the first one, select in the second, SELECT in the third. Although this is not blocking the review, consider sticking to a particular way of writing code :)

My suggestion is, that you type SQL keywords in uppercase: SELECT COUNT(id) FROM task;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I've updated all SQL keywords to uppercase for consistency.

-- 9. Get the name of each status, along with a count of how many tasks have that status
Select status.name as Status_name, count(task.id) AS Status_name_count
From status
LEFT JOIN task on status.id = task.status_id

Choose a reason for hiding this comment

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

The column status_id in the table task cannot be null (this can be checked in the CREATE TABLE statement here). This means that this LEFT JOIN is no different from an INNER JOIN or JOIN (which is the same as an INNER JOIN).

This doesn't block the review either, but I suggest that you use LEFT or RIGHT joins only when they make a difference from an INNER, i.e.: when the column you are joining on can be null.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@FarzanehAhmadi
Copy link
Collaborator Author

Hi Jose! Thanks for the feedback, I really appreciate it! ✨
Regarding merging, as far as I know, we don’t merge our PRs when working in this repository.

@josejfernandez
Copy link

Your latest changes look great Farzaneh! Also, the way you have structured the changes in two independent commits with descriptive and accurate messages is very helpful when collaborating with other developers in a professional environment. Very well done there too!

I'm still figuring out how to best conduct the reviews in HYF - if there is anything else I can do for you, let me know :)

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