postgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
PostgreSQL is a relational database management system. Alternatives: MySQL, SQL Server, and Oracle
What are some advantages of learning a relational database?
Having applications quickly retrieve or store complex data in an organized fashion. Data corruption is unlikely.
What is one way to see if PostgreSQL is running?
sudo service postgresql status
What is a database schema?
A collection of tables
What is a table?
Collection of data items
What is a row?
A data item
What is SQL and how is it different from languages like JavaScript?
It’s the primary way of interacting with relational databases. SQL is a declarative language which means the programmer describes the results they want and the programming environment gets them.
How do you retrieve specific columns from a database table?
SELECT
How do you filter rows based on some specific criteria?
where
What are the benefits of formatting your SQL?
Consistent style and readability
What are four comparison operators that can be used in a where clause?
= != < >
How do you limit the number of rows returned in a result set?
LIMIT
How do you retrieve all columns from a database table?
*
How do you control the sort order of a result set?
order by desc/asc
How do you add a row to a SQL table?
INSERT