-
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
Alishka-databases-w3 #29
base: main
Are you sure you want to change the base?
Alishka-databases-w3 #29
Conversation
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.
You seems comfortable with SQL
It still lacks the exercise on MongoDB
|
||
### 1. What columns violate 1NF? | ||
|
||
The columns **food_code** and **food_description** violate 1NF because they contain multiple values separated by commas instead of atomic values. In 1NF, each column must contain only a single value. |
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.
Correct! You might want to also take a look at the dinner_date
which also has something weird about it
- **Members** | ||
- **Dinners** | ||
- **Venues** | ||
- **Foods** |
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.
👍 🚀
- **Venues** | ||
- **Foods** | ||
|
||
### 3. Name all the tables and columns that would make a 3NF compliant solution. |
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.
Perfect! It shows that you understood really well how data is stored and relate to each other, congratulation!
There is one relation that you might have missed, there is a relation between members and dinners, maybe you can think about it and see what needs to be added to have the perfect database schemas 🚀
}); | ||
|
||
function transferAmount() { | ||
connection.beginTransaction(err => { |
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 does works and it does a transaction thanks to the usage of rollback
and commit
.
One thing to keep in mind is this way of coding transaction will only works in NodeJS/Javascript. To make transaction that would work no matter the language, they need to be done directly in SQL using the SQL statement TRANSACTION
, ROLLBACK
and COMMIT
No description provided.