postgres Flashcards
What is PostgreSQL and what are some alternative relational databases?
relational database management system.
alternative relational databases: SQLite, SQLserver, SQLoracle, mySQL
What are some advantages of learning a relational database?
it is widely used
What is one way to see if PostgreSQL is running?
by using ‘sudo service postgresql status’ in the terminal
What is a database schema?
Defines how the data in a relational database should be organized
schema defines the STRUCTURE
how you want to structure and store our data
What is a table?
A table is a list of rows each having the same set of attributes
attribute - same datatypes
What is a row?
having the same set of attributes
data in the table
What is SQL and how is it different from languages like JavaScript?
structured query language. a powerful way of retrieving, creating, and manipulating data
it’s a declarative programming language whereas JS is imperative
How do you retrieve specific columns from a database table?
using `select “columnName”
How do you filter rows based on some specific criteria?
where “columnName” = ‘thing you want’
What are the benefits of formatting your SQL?
helps to make the queries more readable and easy to understand
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 limit
How do you retrieve all columns from a database table?
using select *
How do you control the sort order of a result set?
order by ___ desc
How do you add a row to a SQL table?
insert into “ “ (“ “, “ “)
values (‘ ‘, ‘ ‘)