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

Oleksandr databases week 3 assignment #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aleksandrvasilyev
Copy link

No description provided.

@ddoyediran ddoyediran self-assigned this Nov 1, 2024
@@ -0,0 +1,39 @@
1. What columns violate 1NF?
- Column member_id must be unique
- dinner_date must be in in one format - date

Choose a reason for hiding this comment

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

Nice catch with the date

@@ -0,0 +1,39 @@
1. What columns violate 1NF?
- Column member_id must be unique

Choose a reason for hiding this comment

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

member_id are unique just that some members had dinners more than once.

try {
const createTables = `
CREATE TABLE IF NOT EXISTS account (
account_number INT AUTO_INCREMENT PRIMARY KEY,

Choose a reason for hiding this comment

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

For security reason, it might not be the best approach to use AUTO_INCREMENT for account. If the account_number is exposed to users, it could be predictable and potentially used for malicious purposes.

const createTables = `
CREATE TABLE IF NOT EXISTS account (
account_number INT AUTO_INCREMENT PRIMARY KEY,
balance INT NOT NULL

Choose a reason for hiding this comment

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

To accurately represent monetary values, it's recommended to use a decimal data type instead of INT as follows balance DECIMAL(10, 2) NOT NULL.

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

Successfully merging this pull request may close these issues.

2 participants