SQL Flashcards
(19 cards)
What is a table?
a collection of data organized into rows and columns.
What is a statement?
Words that database understands as commands
What are the most 6 most common commands?
CREATE TABLE, INSERT INTO
How do you create a new table?
CREATE TABLE
How do you add a new row to table?
INSERT TO
How do you query data from a table?
SELECT
How do you edit a row in a table?
UPDATE
How do you delete rows from a table?
DELETE FROM
How do you filter/list results?
SELECT DINSTINCT “table”
What does WHERE do?
the conditions that rows or cells must meet to be returned
What clause must LIKE follow?
WHERE
Name 3 wildcard characters?
- and _ and %
What does A% do?
Matches any string that begins with “A”
What does %a do?
Matches any string that ends in “a”
How can you order data you want to display?
ORDER BY
How can you set a minimum rows displayed?
LIMIT
How can we combine similar rows from different tables?
JOIN
How can I combine columns from similar tables?
UNION
What’s an example of an IN subquery?
SELECT title FROM songs WHERE title IN (SELECT name FROM artists WHERE genre = “Pop”);