-
Notifications
You must be signed in to change notification settings - Fork 6
Hussam-W1-database #8
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
base: main
Are you sure you want to change the base?
Hussam-W1-database #8
Conversation
yunchen4
left a comment
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.
Hi Hussam,
I didn't see your code for exercise 1. Could you please upload it and let me know on Slack when it is available? Thank you!
Week1/databases/meetup/world.js
Outdated
| const selectCountriesOfContinent=`SELECT name FROM country WHERE continent='Europe';`; | ||
| const res3=await client.query(selectCountriesOfContinent); | ||
| console.log(res3.rows); | ||
| const selectCountriesOrderBysurfaceArea=`SELECT * DROM country ORDER BY surfacearea DESC;`; |
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.
Needs rework: syntax error for SELECT * DROM country ORDER BY surfacearea DESC;
Week1/databases/meetup/world.js
Outdated
| const selectcitiesNamesOfCountry=`SELECT name FROM city WHERE CountryCode='NLD';`; | ||
| const res5=await client.query(selectcitiesNamesOfCountry); | ||
| console.log(res5.rows); | ||
| const selectPopulationOfCity=`SELECT Population FROM city WHERE Name='Roterdam';`; |
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.
Another misspelling for city name SELECT Population FROM city WHERE Name='Roterdam';
Week1/databases/meetup/index.js
Outdated
| const createInviteeTableQuery=`CREATE TABLE IF NOT EXISTS invitee( | ||
| invitee_no SERIAL PRIMARY KEY, | ||
| invitee_name VARCHAR(255) NOT NULL, | ||
| INVITEE_BY VARCHAR(255) 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.
Suggestion: better to keep the column names in the same case (preferably lower case).
Week1/databases/meetup/index.js
Outdated
| const creatRoomTableQuery=`CREATE TABLE IF NOT EXISTS room( | ||
| room_no SERIAL PRIMARY KEY, | ||
| room_name VARCHAR(255) NOT NULL, | ||
| floor_number 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.
Suggestion: usually the floor number is not a big number. Depending on the floor range, you can use type SMALLINT. This way you can reduce the size of table.
You can check the range for the number types: https://www.postgresql.org/docs/current/datatype-numeric.html
No description provided.