d1 - data and database entities Flashcards
what will this postgres command do: \l
lists your databases
what will this postgres command do: \du
list of users
what will this postgres command do: \c
connect to a database
ex. \c
what will this postgres command do: \d
show details of table
what will this postgres command do: \dt
show list of tables
when using a database and pair programming do we both need to setup the DB?
yes! because the DB is only local
what should you do before each time you use homebrew to install somehting?
update homebrew using: brew update
what are some ways to do unique identities in postgres?
NOT NULL
UNIQUE
what will happen when user inputs something null? How does NOT NULL in postgres effect this?
if someone puts some null entity input, an error will occur
what will happen when a user inputs something with the same name and identifier? How does UNIQUE in postgres effect this?
postgres will check rows to see if something already exists, if so, it’ll throw an error
what is postbird?
it’s a gui for postgres
What does RDBMS stand for?
relational database management systems (basically a database)
What are some populare RDBMS?
oracle
SQL server
MySQL
postgreSQL
In postgress when typing what should be in uppercase and what should be in lowercase?
usernames should be in lowercase
*if you wrap the password in “ “ you can make it uppercase but sequilize will do it for us so don’t worry too much
how do you see who your logged in as in postgres?
select CURRENT_USER
if there’s an ‘=’ in the name in postgres that’s good, but what if there’s a ‘-‘?
’-‘ means that your continuing on the same line. So, make sure you end each line with a ‘;’
to get out of that hit ‘;’ and enter
What does SQL stand for?
structured query language (a query is a question. in this case we ask the database a question)
what does -U stand for in postgres?
it stands for user