SQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
o An open-source relational database management system
o MySQL, SQL Server, Oracle
What are some advantages of learning a relational database?
They are widely used so most web developers will work with one at least a little during their career
What is one way to see if PostgreSQL is running?
sudo service postgresql status
What is a database schema?
A collection of tables; it defines how the data should be organized
What is a table(relation)?
A collection of related data
What is a row(tuple)?
A single data item in a table
What is SQL and how is it different from languages like JavaScript?
A domain-specific declarative language used for managing data held in relational database management systems
How do you retrieve specific columns from a database table?
select statement
How do you filter rows based on some specific criteria?
where clause
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?
*
How do you control the sort order of a result set?
order by clause (ascending is default if descending add desc)
How do you update rows in a database table?
update statement