PostgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
Postgres is an open source relational database. MySQL, Microsoft SQL, and Oracle
What are some advantages of learning a relational database?
Web developers will use a database
What is one way to see if PostgreSQL is running?
run sudo service postgreql start in one terminal and run top in another.
What is a database schema?
A collect of tables that your data conforms to.
What is a table?
A list of rows with the same attributes
What is a row?
A single record in the database.
What is SQL and how is it different from languages like JavaScript?
The language used to interact with relational databases. It is declarative.
How do you retrieve specific columns from a database table?
select “blank” from “blank”
How do you filter rows based on some specific criteria?
where clause
What are the benefits of formatting your SQL?
Makes it easier to find certain rows or columns
What are four comparison operators that can be used in a where clause?
equal, less than, greater than, not equal
How do you limit the number of rows returned in a result set?
Limit clause followed by number
How do you retrieve all columns from a database table?
select *
How do you control the sort order of a result set?
Order by price - (auto ascending)
order by price “price” desc
How do you add a row to a SQL table?
insert clause
into ‘table name’