postgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
an open source Relational Database Management System (RDBMS)
MySQL, SQL Server, Oracle
What are some advantages of learning a relational database?
they support good guarantees about data integrity, store and modify data in a way that makes data corruption as unlikely as possible. Learning databases are a transferable skill
What is one way to see if PostgreSQL is running?
sudo service postgresql status, or top
What is a database schema?
A collection of tables, how the data in a relational database should be organized.
What is a table?
relations - where relational databases are store data in
a set of rows.
a collection of related data held in a table format within a database. It consists of columns and rows.
What is a row?
a data record within a table. Each row, which represents a complete record of specific item data, holds different data within the same structure.
What is SQL and how is it different from languages like JavaScript?
Structured Query Language (SQL) - primary way of interacting with relational databases
- a declarative programming language
How do you retrieve specific columns from a database table?
select “column1”,
“column2”
from “table
How do you filter rows based on some specific criteria?
where “column1” = ‘data’,
limit
What are the benefits of formatting your SQL?
for consistent style and 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 #
How do you retrieve all columns from a database table?
select *
How do you control the sort order of a result set?
order by “columnName” asc/desc
How do you add a row to a SQL table?
insert into “tableName” (“column1”, “column2”)
values (‘value1’, ‘value2’)