Postgres Flashcards
What is PostgreSQL and what are some alternative relational databases?
It is a place to store data. It is an open source relational Database meaning that the data is related to other data that you are storing or the data is interconnected. Redis, MySQL, Oracle
What are some advantages of learning a relational database?
It is one of the most widely used kind of database. Learning SQL is a transferable skill because a lot of relational databases are driven by the same language. Guarantees data integrity through ACID.
Atomicity consistency isolation and durability.
What is one way to see if PostgreSQL is running?
using sudo service postgresql status
What does the ACID acronym stand for?
Atomicity consistency isolation and durability.
Atomicity
Each statement is treated as a single unit. Meaning that if one unit fails all the units fail. Meaning there are no half transfers.
Consistency
transactions can only bring the database from one valid state to another.
Isolation
The database is in the same state. One transaction does not effect other transactions
Durability
That once a transaction has been committed it will stay committed even if there is a crash.
What is a database schema?
schema means plan or organization so its an abstraction that represents the storage model of data in a database. In a relational database schema tables will be interconnected to one another.
What is a table?
It’s own entity. Would be an object that relates to other objects within the schema. Think Actor film all different tables that represent an object but relate to each other
What is a row?
a row is a value that is matched with a property which is a column/ attributes.
What is SQL and how is it different from languages like JavaScript?
Structured Query Language used for managing data in a relational data base. SQL is declarative meaning that you describe the results you want and the database will try to match your input
How do you retrieve specific columns from a database table?
you use a select statement and grab the attributes/columns from the table that you choose.
How do you filter rows based on some specific criteria?
you use a where clause with a comparison operator and a value
What are the benefits of formatting your SQL?
It is easier to read