-
Notifications
You must be signed in to change notification settings - Fork 33
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
DB Challenges / Javier Flores #50
base: main
Are you sure you want to change the base?
Conversation
jffc-dev
commented
Nov 28, 2024
- Implemented the getCurrentAmount function to avoid code repetition across multiple exercises.
- Created the generateMovement stored procedure to simulate a movement, including all required validations.
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.
Good solution overall, and nice you formatted your queries that help when you are reading. I left some comments about improvements, only exercise 5 of the second challenge has to be solved differently.
A general comment when you assign the table's name after the FROM
statement I prefer to use the 3 letters that help when you read the query.
We'll talk about your ERD solution in the feedback meeting.
INNER JOIN states AS S ON O.state_id = S.id | ||
INNER JOIN countries AS C ON O.country_id = C.id | ||
WHERE S.name = 'Colorado' | ||
AND C.name = 'United States'; |
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.
nit: We do not need the country name in the WHERE
statement since we know the state name is unique.
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 initially had that approach, but when I reviewed the schema, I noticed there was no unique constraint on the name field in the state table.
-- 5 | ||
-- Using a store procedure that simulates a movement |
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.
issue: in this exercise at the begging said In this part, you need to CRATE A TRANSACTION with the following steps
, and within that transaction, you have to develop each literal