SQL Flashcards
From Facebook Blueprint SQL lessons (not included in the MarSci Study Guide)
Name this type of JOIN:
LEFT JOIN
Name this type of JOIN:
FULL OUTER JOIN
Name this type of JOIN:
INNER JOIN
Name this type of JOIN:
RIGHT JOIN
What is the name of the programming language designed to communicate with databases?
SQL
SQL stores data in tables, also known as what?
relational database structures
What SQL query is considered the most basic form?
SELECT
What SQL statement is used to retrieve data from all columns in a table or to retrieve data from specified columns?
SELECT
Fill in the blank: In order to get all all data from a customers table, use the _____ _ _____ query.
SELECT * FROM
Scenario:
There is one table of data called “customers.” We need to get ids, first names, last names, and age from the “customers” table.
What query would we write to do this?
SELECT customer_id, first_name, last_name, customer_age
FROM customers
What SQL clause filters results?
WHERE
Scenario:
There is one table of data called “customers.” We want to get first names and last names from the table, but only of those customers who are less than 35 years old.
What query would we write to do this?
SELECT first_name, last_name
FROM customers
WHERE age < 35
Scenario:
There is one table of data called “customers.” We want to get customer IDs from the table, but only for those who have the last name “Smith.”
What query would we write to do this?
SELECT customers_id
FROM customers
WHERE last_name = ‘Smith’
Fill in the blank: _____ _____ is a SQL query used to sort data
ORDER BY
What SQL query returns results in ascending order by default?
ORDER BY