-
Notifications
You must be signed in to change notification settings - Fork 6
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
Assignment w2 HANNA MELNYK #13
base: main
Are you sure you want to change the base?
Assignment w2 HANNA MELNYK #13
Conversation
Exercises are going very well. Easy to read and review. But exercise 4 is failing. It is something very small that is raising an error. Could you investigate the issue, please? When we run it, we get this:
|
Rafael, thanks for the feedback! |
So quick. Thanks for checking. But the issue is not on the Try to compare how you are calling the SQL methods (try checking how you are calling the |
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.
It is really good. Congratulations. I just wanted to share a suggestion, but the query provided works good.
const getSumOfPapersByFemaleAuthors = (connection) => { | ||
return new Promise((resolve, reject) => { | ||
const query = ` | ||
SELECT |
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.
I would recommend to do this query like this:
SELECT
COUNT(author_papers.paper_id) AS total_papers
FROM
author_papers
LEFT JOIN
authors ON author_papers.author_id = authors.author_id
WHERE authors.gender = 'Female'
If we have a index for gender, the performance would be better because we don't need to go through all rows.
But your answer is correct. I would just recommend use WHERE if possible.
No description provided.