PostgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
It is a relational database, and alternatives are: MySQL (also free), SQL Server by Microsoft, and Oracle by Oracle Corporation
What are some advantages of learning a relational database?
Use to store related data, maximize data integrity, learn SQL language
What is one way to see if PostgreSQL is running?
Run top, check status with sudo service postgresql status
What is a database schema?
A collection of tables that describe how the DB should be organized
What is a table?
List of rows with same attributes
What is a row?
data with same attributes
What is SQL and how is it different from languages like JavaScript?
structured query language capable of interacting with relational databases. Its a declarative language
How do you retrieve specific columns from a database table?
select keyword
How do you filter rows based on some specific criteria?
where keyword
What are the benefits of formatting your SQL?
increases readability, easier to spot errors
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 keyword
How do you retrieve all columns from a database table?
*
How do you control the sort order of a result set?
order by
How do you add a row to a SQL table?
insert into “table name” (‘attributes’)
values (‘values’);