PostgreSQL Flashcards
What is PostgreSQL?
A free, open source Relational Database Management System. That provides robust features, meets standards compliance, and reliability.
What are some advantages of learning a relational database?
- To understand and solve problems based around storing and pulling up data.
- To be able to reject bad data and not worry about half written data
What is one way to see if PostgreSQL is running?
- Check to see if postgresql processes are running in top command
- Type in sudo service postgresql status
What are some alternative relational databases?
MySQL, SQL Server by Microsoft, and Oracle by Oracle.
What is a database schema?
A collection of tables.
- Defines how data in a relational database is organized.
What is a table?
A relational database that stores data in relations.
- It is a list of rows each having the same set of attributes.
What is a row?
A list from a table that has the same attributes.
What is SQL?
Stands for Structured Query Language
- Primary way of interacting with relational databases
- Retrieves, creates, and manipulates data in a relational database
How do you retrieve specific columns from a database table?
select keyword
comma-separated list of column names surrounded by “ “
from clause which specifies which table to get data
ends with a semicolon
How do you filter rows based on some specific criteria?
Using the where clause
- Comes after the from clause
- Column headers will have double quotes while text values have single quotes
What are the benefits of formatting your SQL?
Creates a consistent style and therefore makes SQL easier to read
How is SQL different from languages like JavaScript?
SQL is a declarative programming language.
- Programmer describes the results they want and the program comes up with a plan to get those results
What are four comparison operators that can be used in a where clause?
equals sign =
greater than >
less than <
not equal !=
How do you limit the number of rows returned in a result set?
Using the limit clause
- This will come last in a select statement
- Is a literal integer
How do you retrieve all columns from a database table?
Using an asterisk *