PostgreSQL Flashcards
What is PostgreSQl and what are some alternative relational databases?
Open source object-relational database system
alternatives: mySQL, SQL server, Oracle
What are some advantages of learning a relational database?
You work with the SQL language, and a majority of databases use SQL
What is one way to see if PostgreSQL is running?
sudo service postgresql status
What is a database schema?
collection of tables in sql
What is a table?
list of rows each having the same set of attributes.
ex. student table can all have attributes: “firstName” , “lastName” , and “dateOfBirth
What is a row?
a record of the table with data
What is SQL and how is it different from languages like JavaScript?
Structured Query Language - it is declarative meaning programmers describe the results they want and the programming environments gets those results
How do you retrieve specific columns from a database table?
Select “columnName” from “tableName”;
How do you filter rows based on some specific criteria?
Where “” = ‘’
What are the benefits of formatting your SQL?
easier to read
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
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 “tableName” (“columnName”) values (‘valueName’) returning *;