postgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
PostgreSQL is a powerful, free, open source Relational Database Management System (RDBMS).
alternatives: SQLite, MySQL, SQL Server by Microsoft, and Oracle by Oracle Corporation.
What are some advantages of learning a relational database?
- they support good guarantees about data integrity
- store and modify data in a way that makes data corruption as unlikely as possible
What is one way to see if PostgreSQL is running?
sudo service postgresql status
What is a database schema?
A collection of tables and it defines how the data in a relational database should be organized
What is a table?
a collection of rows that have the same attribute
What is a row?
a single record in a table
What is SQL and how is it different from languages like JavaScript?
Structured Query Language (SQL) lets you access and manipulate databases. it is a declarative language while javascript is imperative
How do you retrieve specific columns from a database table?
select “columnName1”, “columnName2”, …
How do you filter rows based on some specific criteria?
where clause
What are the benefits of formatting your SQL?
easier to read
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 clause
How do you retrieve all columns from a database table?
*
How do you control the sort order of a result set?
order by clause
How do you add a row to a SQL table?
insert statement