PostreSQL Flashcards
Why do we use databases in Web development?
It is quicker to query, organize, get access to data from a database. Store a lot of information. Data less likely to be stolen or corrupted, can be accessed by many computers/phones by many users.
What is PostgreSQL and what are some alternative relational databases?
An open source relational database. microsoft SQL server, MySQL, SQLite.
What are some advantages of learning a relational database?
What is one way to see if PostgreSQL is running?
using the top
command.
sudo service postgresql status.
sudo = super user do.
pgweb
pgweb queries your postgres database and visualizing it for you.
What is a database schema?
A collection of tables
What is a table?
A table is a list of rows each having the same set of attributes.
every row in a table should have the same columns.
What is a row?
an object, an instance of the data, a data point,
A row is a single set of data with all columns that describe pieces of the data.
What is an attribute and what other names are used to describe them?
Attributes are commonly referred to as columns. Keys, properties.
What is SQL and how is it different from languages like JavaScript?
Structured Query Language, SQL is a declarative programming language which means you tell it the results you want, not what to do, as opposed to JavaScript which is an imperative programming language.
How do you retrieve specific columns from a database table?
by using the select keyword followed by the column names in double quotes separated by commas.
How do you filter rows based on some specific criteria?
by using the where keyword followed by the column name in double quotes, and then a comparison to the value in single quotes. an expression.
What are the benefits of formatting your SQL?
SQL does not have to be indented, but you should do it anyway for consistent style and therefore 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?
using the limit keyword followed by a number where the number is the max number of rows to be returned.