Skip to content

Hamed R. - #13

Open
HamedRazizadeh-hub wants to merge 2 commits into
HackYourAssignment:mainfrom
HamedRazizadeh-hub:main
Open

HamedRazizadeh-hub wants to merge 2 commits into
HackYourAssignment:mainfrom
HamedRazizadeh-hub:main

Conversation

@HamedRazizadeh-hub

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 on finishing the assigment! 👏 👏

Task 2 has a very clear and solid code and works as expected.

Task 1 also has good queries, but some improvement points on getting the results.

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

Comment thread task-1/queries.sql
SELECT title, published_year
FROM books
WHERE published_year < 1950;
ORDER BY published_year ASC;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You finished the query before with a ; and then you have the ORDER BY not linked with the previous line, that would cause an error. And the question doesn't ask for ordering ;)

Comment thread task-1/queries.sql
-- **Question 4** — List all books written by Stephen King. Show the title and published year, ordered by year. _(Hint: JOIN the two tables and filter on the author's name.)_
SELECT
books.title,
authors.first_name || ' ' || authors.last_name AS author

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very good written query, but the question asks for title and published year ;)

Comment thread task-1/queries.sql
-- **Question 6** — Add one book for the author you just inserted. It can be a real book or a made-up one.
INSERT INTO books (title, author_id, genre, published_year)
VALUES ('Freedom For IRAN',
(SELECT id FROM authors WHERE first_name = 'Hamed' AND last_name = 'Razizadeh'), 'Documentary', 2026);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👏 👏 Very good option on choosing SELECT to get the id. Imagine that you a have a big database with a lot of lines. Than this saves time to search the specific id

Comment thread task-1/queries.sql

---
DELETE FROM books
WHERE id = 101;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How would write this if you don't know the id to be deleted?

Comment thread task-1/queries.sql
-- These cover topics slightly beyond the core material. Have a go if you finish early.

-- **Bonus A** — How many books are there per genre? Show the genre name and the count, ordered from most to fewest books.
SELECT genre, COUNT(*) AS book_count

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 choise on using alias here!

Comment thread task-2/src/database.js
@@ -21,23 +21,35 @@ const db = new Database(DB_FILE);

export function getAllDecks() {
// TODO: return all rows from the decks table

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👏 Great use of TODO! How was your choise of using? You first wrote them and then you write the code later? Usually developers commit TODO to point a change that is necessary later in future. So as you developed all items, you can remove the TODO comments :D

@rafasilpereira rafasilpereira added Reviewed This assignment has been reivewed by a mentor and a feedback has been provided and removed Review in progress labels 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