SQL Flashcards
What is PostgreSQL and what are some alternative relational databases?
It is a relation database management system . other relational databases include MySQL, SQL Server by Microsoft, and Oracle
What are some advantages of learning a relational database?
portable skill, and used everywhere
What is one way to see if PostgreSQL is running?
top command,
What is a database schema?
A collection of tables
What is a table?
in terms of relational databases, a table is known as a relation which stores data in rows and attributes(columns)
What is a row?
a row is an instance of a record in that table, that has a set of attributes
What is SQL and how is it different from languages like JavaScript?
Structured Query Language: it is declarative vs imperative like JavaScript.
How do you retrieve specific columns from a database table?
select “columnName”
How do you filter rows based on some specific criteria?
where “column” (=,, !=) ‘criteria’
What are the benefits of formatting your SQL?
readabililty
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 “criteria” (desc)
- ascending by default
How do you add a row to a SQL table?
insert into “table” (‘column’(s))
values (‘value’(s))