SQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
a free open source Relational Database Management System, MySQL, SQL Server (Microsoft), Oracle (Oracle Corporation)
What are some advantages of learning a relational database?
they are the most widely used kind of database
What is one way to see if PostgreSQL is running?
sudo service postgresql status or top
What is a database schema?
a description of how data should be structured
What is a table?
a list of rows having the same set of attributes
What is a row?
all of the data for an individual entry
What is SQL and how is it different from languages like JavaScript?
Structured Query Language, the primary way of interacting with relational databases, declarative programming language (like HTML and CSS)
How do you retrieve specific columns from a database table?
select “column”, from “table”
How do you filter rows based on some specific criteria?
where “column” = ‘value’
What are the benefits of formatting your SQL?
readability, style consistency
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 #
How do you retrieve all columns from a database table?
select *
How do you control the sort order of a result set?
order by “column” (desc)
How do you add a row to a SQL table?
insert into “table” (“column”)
values (‘value’)