SQL Flashcards

Week 2.3 (20 cards)

1
Q

advantages of using a database

A
  1. centralised
  2. less redundancy
  3. concurrent access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

SELECT

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

FROM

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

WHERE

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

LIKE

A

‘X%’
‘%X’
‘%X%’

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

ORDER BY

A

ASC DESC

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

LIMIT

A

how many rows to display

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

GROUP BY

A

combines all rows where the specified column is the same

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

AVG(x)

A

calculates the average of x

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

HAVING

A

exclude certain rows from the aggregate

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

MIN()

A

finds the smallest value

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

MAX()

A

finds the largest valur

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

SUM()

A

calculates the sum of all values

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

COUNT()

A

the number of rows in the set

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

AS

A

renames an aggregate column

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

JOIN

A

used to gather data from more than one table

16
Q

INNER JOIN

A

only shows rows where an id matching the input was found. the intersection of the 2 tables

17
Q

FULL OUTER JOIN

A

this will display every row of both tables whether a match was found or not

18
Q

LEFT JOIN

A

display all rows from the first table & all rows with a match from the second table

19
Q

RIGHT JOIN

A

displays all rows from the 2nd table & all matching rows from the first