postgres & sql Flashcards
Why do we use databases in Web development?
for applications to quickly retrieve or store complex data in an organized fashion and to share data to other users and provide a centralized location for application data.
What is PostgreSQL and what are some alternative relational databases?
a free open source database Relational Database Management System (RDBMS). some alternatives are MySQL, SQL Server, and Oracle.
What are some advantages of learning a relational database?
they can store and modify data in a way that makes data corruption as unlikely as possible.
What is one way to see if PostgreSQL is running?
sudo (super user do) service postgresql status
What is a database schema?
a collection of tables that defines how the data in relational database should be organized
What is a table?
Relational databases store data in relations. a collection of objects that are the same shape.
What is a row?
a table each having the same set of attributes. an object or item
What is an attribute and what other names are used to describe them?
column, key
What is SQL and how is it different from languages like JavaScript?
its a declarative programming language and you just tell it what you want not how.
How do you retrieve specific columns from a database table?
by using the select and column names after select in double quotes.
How do you filter rows based on some specific criteria?
by using the ‘where’ clause and any type of expression and the data type value is surrounded by single quotes only if its a string
What are the benefits of formatting your SQL?
to make it more readability
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?
use the limit keyword
How do you retrieve all columns from a database table?
use the * to get all columns