-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: main
Are you sure you want to change the base?
Oleksandr databases week 3 assignment #37
Conversation
@@ -0,0 +1,39 @@ | |||
1. What columns violate 1NF? | |||
- Column member_id must be unique | |||
- dinner_date must be in in one format - date |
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.
Nice catch with the date
@@ -0,0 +1,39 @@ | |||
1. What columns violate 1NF? | |||
- Column member_id must be 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.
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, |
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.
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 |
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.
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
.
No description provided.