PostgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
pronounced “Post Gress Queue El”, PostgreSQL is a powerful, free, open source Relational Database Management System (RDBMS).
Alternatives - MySQL, SQL Server by MIcrosoft, and Oracle by Oracle Corporation.
What are some advantages of learning a relational database?
They can store and modify data in a way that makes data corruption as unlikely as possible.
You can store related data.
Relational Databases are the most widely used kind of database.
What is one way to see if PostgreSQL is running?
use the command ‘ sudo service postgresql status ‘.
psql
the command to acces PostgreSQL in the terminal.
pgweb
is just a graphical user interface for the PostgreSQL database.
What is a database schema?
A collection of tables , and defines how the data in a relational database should be organized.
defines the structure of a database.
What is a table?
A table is a list of rows each having the same set of attributes.
Ex - all students in a “students” table could have “firstName”, “lastName”, and “dateOfBirth” attributes.
Attributes are commonly referred to as tables.
What is a row?
each row in a table is a record of data
a row is a data record within a table.
holds data that correlates to the attribute or column .
the stored or collected data.
What is SQL and how is it different from languages like JavaScript?
SQL is a declarative programming language which means you describe the results you want and then its up to the programming environment to come up with a plan for getting the results, whereas JavaScript is imperative which means you tell the program / runtime what to do and how to do it.
How do you retrieve specific columns from a database table?
use the select keyword followed by a comma-separated list of column names, each surrounded by “ double quotes.
select column
from table name;
How do you filter rows based on some specific criteria?
use the where clause, which uses operators.
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?
The limit clause includes a literal integer number with no quotes to specify the maximum number of rows that should be returned.
How do you retrieve all columns from a database table?
use the * (asterick) after the select keyword.