PostgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
Relational database
What are some advantages of learning a relational database?
very transferrable skill
What is one way to see if PostgreSQL is running?
running a status command
sudo service postgresql status
What is a database schema?
a description of how the data will be laid out, formatted
What is a table?
the stored data including entries (rows) and all attributes (columns)
What is a row?
the actual data values for the attributes in the database
What is SQL and how is it different from languages like JavaScript?
structured query language, a declarative language
How do you retrieve specific columns from a database table?
select “colName”,
“alsoThisCol”
from “tableName”;
How do you filter rows based on some specific criteria?
where “colName” = ‘stuff”
What are the benefits of formatting your SQL?
easier to read longer queries
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 with a number
How do you retrieve all columns from a database table?
select * from “tableName”
How do you add a row to a SQL table?
insert into
How do you get back the row being inserted into a table without a separate select statement?
returning *