Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Alishka-Space
Copy link

No description provided.

@sarlam sarlam self-assigned this Sep 1, 2024
Copy link

@sarlam sarlam left a 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.
Copy link

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

Comment on lines +10 to +13
- **Members**
- **Dinners**
- **Venues**
- **Foods**
Copy link

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.
Copy link

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 => {
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants