SQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
it’s an open source relational database, alts are mySQL, SQLite, SnowFlake
What are some advantages of learning a relational database?
they’re everywhere so if you learn one, you learn a lot of them
What is one way to see if PostgreSQL is running?
check top or sudo service postgresql status
What is a database schema?
a collection of tables in a database
What is a table?
a list of rows all having the same attributes
What is a row?
one entry in a table that has an attribute value
What is SQL and how is it different from languages like JavaScript?
its a declarative language vs JS is imperative
How do you retrieve specific columns from a database table?
select “column name”
“additional columns. . .”
from “table name”;
How do you filter rows based on some specific criteria?
where clause and an expression that evaluates to a boolean
What are the benefits of formatting your SQL?
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 clause
How do you retrieve all columns from a database table?
select *
How do you control the sort order of a result set?
order by clause with asc and desc
How do you add a row to a SQL table?
insert into statement