Skip to content

Jawad A.#8

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

Jawad A.#8
jivvyjams wants to merge 4 commits into
HackYourAssignment:mainfrom
jivvyjams:main

Conversation

@jivvyjams
Copy link
Copy Markdown

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

📝 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

@remarcmij remarcmij self-assigned this Apr 1, 2026
Copy link
Copy Markdown

@remarcmij remarcmij left a comment

Choose a reason for hiding this comment

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

Hi @jivvyjams, some minor issues in task-1. In task 2, I sense some use of AI agents, which makes it a bit more difficult for me to assess your work.

Comment thread task-1/queries.sql
Comment on lines +55 to +56
(id, title, published_year genre, author_id)
VALUES (101, 'SQL for Beginners', 2026, 'Non-fiction', 25);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  1. This SQL statement produces a syntax error because of a missing comma.
  2. The books table has an AUTOINCREMENT clause. It will generate an id for you. You should not create it yourself, as this may conflict with auto-generated IDs.
Suggested change
(id, title, published_year genre, author_id)
VALUES (101, 'SQL for Beginners', 2026, 'Non-fiction', 25);
(title, published_year, genre, author_id)
VALUES ('SQL for Beginners', 2026, 'Non-fiction', 25);

Comment thread task-1/queries.sql
Comment on lines +38 to +39
(id, first_name, last_name, nationality, birth_year)
VALUES (25, 'Jawad', 'Al Bdiwi', 'Syrian', '1994');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The authors table has an AUTOINCREMENT clause. It will generate an ID for you. You should not create it yourself, as this may conflict with auto-generated IDs.

Suggested change
(id, first_name, last_name, nationality, birth_year)
VALUES (25, 'Jawad', 'Al Bdiwi', 'Syrian', '1994');
(first_name, last_name, nationality, birth_year)
VALUES (Jawad', 'Al Bdiwi', 'Syrian', '1994');

Comment thread task-1/queries.sql
Comment on lines +5 to +6
SELECT * FROM books WHERE genre = 'Science Fiction'
ORDER BY published_year DESC;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For better readability, place the WHERE clause on a separate line.

Suggested change
SELECT * FROM books WHERE genre = 'Science Fiction'
ORDER BY published_year DESC;
SELECT * FROM books
WHERE genre = 'Science Fiction'
ORDER BY published_year DESC;

Comment thread task-1/queries.sql
-- Display the title and year only.

-- **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 title, published_year FROM books WHERE published_year < 1950;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same here.

Comment thread task-1/queries.sql
SELECT title, published_year
FROM books b
INNER JOIN authors a ON b.author_id = a.id
WHERE a.last_name = 'King'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What if the database contains other authors with the last name of "King"?

Comment thread task-2/src/storage.js
// This file now uses SQLite instead of JSON

import { readFileSync, writeFileSync } from 'fs';
import Database from 'better-sqlite3';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why did you change storage.js? The task only asked you to implement database.js.

Comment thread task-2/src/storage.js
// This file handles all reading and writing of data.
// Currently it uses a JSON file on disk.
// In the assignment you will replace each function here with a SQLite query.
// This file now uses SQLite instead of JSON
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Was this comment added by an AI agent?

Comment thread task-2/migrate.js
);
}

console.log('✅ Migration done!'); No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks perfect. Maybe too perfect to be completely your own work? Note that AI tools love inserting emojis.

Comment thread task-2/setup.sql
FOREIGN KEY (deck_id) REFERENCES decks(id)
);

SELECT * FROM decks;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this needed?

Comment thread task-2/src/storage.js
}
const info = db.prepare('DELETE FROM cards WHERE id = ?').run(cardId);
return info.changes > 0;
} No newline at end of file
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 works fine, but I get the impression that you got a helping hand from an AI agent.

@remarcmij remarcmij added the Reviewed This assignment has been reivewed by a mentor and a feedback has been provided label Apr 4, 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