postgres/sql Flashcards
Why do we use databases in Web development?
to store data and information
What is PostgreSQL and what are some alternative relational databases?
PostgreSQL is a data management system and other alternatives include Oracle, MySQL
What are some advantages of learning a relational database?
Ease of use, open source, flexibility
What is one way to see if PostgreSQL is running?
sudo service postgresql status
What is a database schema?
it shows how a data is organized within the database
What is a table?
rows and columns used to store data titles and the data itself
What is a row?
the horizontal part of the table
What is an attribute and what other names are used to describe them?
an attribute in postgresql is the column in the postgresql table it shows the information of the data type
What is SQL and how is it different from languages like JavaScript?
Structured query language (SQL) is a way to interact with databases and it is different from JavaScript you tell it how to do it while in SQL you ask what you want
How do you retrieve specific columns from a database table?
by using the select clause
(ex. select “firstName”, “lastName”
from “table_name”)
How do you filter rows based on some specific criteria?
by using the where clause
(ex. where “lastName” = ‘Lee’)
What are the benefits of formatting your SQL?
for readability purposes
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?
by using the limit clause
(ex. limit 10;)
How do you retrieve all columns from a database table?
by using an *
(ex. select *
from “table_name”;)