Databases Flashcards
What is PostgreSQL and what are some alternative relational databases?
open-source relational database system; some others are MySQL, SQL Server, and Oracle
What are some advantages of learning a relational database?
good for modeling and storing related data; also supports good guarantees about data integrity
What is one way to see if PostgreSQL is running?
sudo service postgresql status
What is a database schema?
a collection of tables in a relational database that defines how the data should be organized
What is a table?
a list of rows each having the same set of attributes
What is a row?
a record in the database
What is SQL and how is it different from languages like JavaScript?
SQL is a declarative programming language, while JavaScript is an imperative programming language
How do you retrieve specific columns from a database table?
select clause indicating column names
How do you filter rows based on some specific criteria?
where clause
What are the benefits of formatting your SQL?
consistent style and 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?
limit clause
How do you retrieve all columns from a database table?
select *
How do you control the sort order of a result set?
order by
How do you add a row to a SQL table?
insert into “tableName” (“columnNames”)
values (‘values’)