Skip to content

Mohamad Bader AA - #20

Open
noneeeed wants to merge 4 commits into
HackYourAssignment:mainfrom
noneeeed:main
Open

noneeeed wants to merge 4 commits into
HackYourAssignment:mainfrom
noneeeed:main

Conversation

@noneeeed

@noneeeed noneeeed commented Apr 1, 2026

Copy link
Copy Markdown

No description provided.

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown

📝 HackYourFuture auto grade

Assignment Score: 0 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 0
🧪 The auto grade is experimental and still being improved

Test Details

@rafasilpereira rafasilpereira 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.

Well done with the implementation! And all results are working well!

Another point that is good is the commit messages - very clear on what you had done and the steps of your development. This makes clear for other developer to review your code.

Tip for next time is create a branch with the name of the assignement (e.g week-12-assignement). Usually you keep in main your last version and your proposal to change goes in a branch that will be merged in main ;)

Happy to help you if you have any doubt about my comments!

Comment thread task-1/queries.sql
ORDER BY b.published_year ASC;

-- **Question 5** — Add yourself as a new author. Use your real name, or make one up. Pick any nationality and birth year.
SELECT * FROM authors;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This SELECT doesn't show the line inserted below. How would you check that it worked porperly?

Comment thread task-1/queries.sql
INSERT INTO books (title, author_id, genre, published_year)
VALUES (
'Potatos Adventure',
(SELECT id FROM authors WHERE first_name = 'Bader' LIMIT 1),

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 approach on this one on not to add the author_id directly but search in the database. But I have a question: If there is a author name as Aaron Bader, who would you think that would get this new book? Aaron Bader or Almsaddi Bader?

Comment thread task-1/queries.sql
-- **Question 7** — The genre for "The Dark Tower: The Gunslinger" was entered incorrectly as `'Fantasy'`. It should be `'Horror'`. Write an UPDATE to fix it, then verify the change with a SELECT.
UPDATE books
SET genre = 'Horror'
WHERE title LIKE '%Gunslinger%';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider the requests and the data possibility that you can have in your table is important. A query without consider this aspects could affect unrelated data.
What would happen with the book Phantom Gunslinger with this query?

Comment thread task-2/src/database.js
// TODO: return all rows from the decks table
throw new Error('Not implemented');
return db.prepare("SELECT * FROM decks").all();
throw new Error("Not implemented");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This throw would never be executed, so what do you think of removing them? Unless you want to throw an expecific Error message if an error happened in database (check Week 10 :D )

Comment thread task-2/src/migrate.js
for (const card of data.cards) {
insertCard.run({
...card,
learned: card.learned ? 1 : 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use of ternary operator saves a lot of code for condition check. Well done!

@rafasilpereira rafasilpereira added the Reviewed This assignment has been reivewed by a mentor and a feedback has been provided label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants