PostgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
PostgreSQL is a relational database system that is free and open source. Some alternatives are MySQL, SQL Server, and Oracle.
What are some advantages of learning a relational database?
The most widely used kind of database. SQL is a very useful skill to have. Data corruption is very unlikely to happen in a relational database.
What is one way to see if PostgreSQL is running?
By having a 2nd terminal open and running the top command to monitor the open processes.
What is a database schema?
A schema defines how the data in a relational database is organized.
What is a table?
A table is a list of rows each having the same set of attributes(columns).
What is a row?
A row is each individual record or entry that has a set of attributes/columns.
What is SQL and how is it different from languages like JavaScript?
SQLis considered a declarative language. Meaning programmers can declare their intent and the output is the desired result.
How do you retrieve specific columns from a database table?
select “name of column”
How do you filter rows based on some specific criteria?
where “column” (operator) ‘criteria’
What are the benefits of formatting your SQL?
Readability. For the business side of things to interpret the data. Consistency.
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 (number)
How do you retrieve all columns from a database table?
select asterisk*
How do you control the sort order of a result set?
using order by “column”
How do you add a row to a SQL table?
insert into clause followed by the “table” then (column names separated by commas)