SQL Flashcards

1
Q

What is a table?

A

a collection of data organized into rows and columns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a statement?

A

Words that database understands as commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the most 6 most common commands?

A

CREATE TABLE, INSERT INTO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you create a new table?

A

CREATE TABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you add a new row to table?

A

INSERT TO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you query data from a table?

A

SELECT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you edit a row in a table?

A

UPDATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you delete rows from a table?

A

DELETE FROM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you filter/list results?

A

SELECT DINSTINCT “table”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does WHERE do?

A

the conditions that rows or cells must meet to be returned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What clause must LIKE follow?

A

WHERE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name 3 wildcard characters?

A
  • and _ and %
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does A% do?

A

Matches any string that begins with “A”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does %a do?

A

Matches any string that ends in “a”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How can you order data you want to display?

A

ORDER BY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you set a minimum rows displayed?

A

LIMIT

17
Q

How can we combine similar rows from different tables?

A

JOIN

18
Q

How can I combine columns from similar tables?

A

UNION

19
Q

What’s an example of an IN subquery?

A

SELECT title FROM songs WHERE title IN (SELECT name FROM artists WHERE genre = “Pop”);