PostgreSQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
- Relational Database Management System
- MySQL, SQLite
What are some advantages of learning a relational database?
- Support good guarantees about data integrity
- Store and modify data in a way that makes data corruption as unlikely as possible
- Most widely used kind of database
What is one way to see if PostgreSQL is running?
- Running the top command and checking to see postgres processes
- sudo service postgresql status
What is a database schema?
-Collection of tables
What is a table?
- Data stored in relations in relational database
- List of rows each having the same set of attributes
What is a row?
-A row represents a complete record of a specific data
What is SQL and how is it different from languages like JavaScript?
- SQL is declarative programming language and JavaScript is imperative programming language
- Programmers describe the result
How do you retrieve specific columns from a database table?
-select statement
How do you filter rows based on some specific criteria?
-where clause
What are the benefits of formatting your SQL?
-Easy to find
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 clause
How do you retrieve all columns from a database table?
-asterisk
How do you control the sort order of a result set?
-order by clause
How do you add a row to a SQL table?
-insert keyword