PostgreSQL Flashcards
1
Q
What is PostgreSQL?
A
its an open source relational database.
2
Q
What is one way to see if PostgreSQL is running?
A
sudo service postgresql status
3
Q
what is a database schema?
A
Collection of tables and how they are structured
4
Q
What is a table?
A
- List of rows with the same attributes or columns
5
Q
- What is a row?
A
- List of values that add up with the attributes in the table
6
Q
- What is SQL and how is it different from languages like JavaScript?
A
- Structured Query Language is the primary way of interacting with relational databases. It’s a declarative language
7
Q
How do you retrieve specific columns from a database table?
A
- Select “column” from “table”
8
Q
- How do you filter rows based on some specific criteria?
A
- Where clause with pretiquite (where “firstName” = ‘Rob’)
9
Q
- What are the benefits of formatting your SQL?
A
- Makes it easier to read
10
Q
- What are four comparison operators that can be used in awhereclause?
A
- =, < , >, !=
11
Q
- How do you limit the number of rows returned in a result set?
A
- Limit
12
Q
- How do you retrieve all columns from a database table?
A
- Select *
13
Q
- How do you control the sort order of a result set?
A
- Order by column name (desc)
14
Q
- How do you add a row to a SQL table?* What is a tuple?
A
- Insert into “table” (“column”, “column”, “column”)
values (‘name’, ‘name’, name’)
15
Q
What is a tuple?
A
- A list of values in parenthesis