16 tm 19 Flashcards

1
Q

custom table city en state uit database customers

A

SELECT CONCAT(city, ‘ , ‘ , state) FROM customers

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

custom table city en state uit database customers en geef de nieuwe custom table de naam new_address

A

SELECT CONCAT(city, ‘ , ‘ , state) AS new_address FROM customers

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

toon de tabel name in CAPS uit database customers

A

SELECT name, UPPER(name) FROM customers

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

command voor gemiddelde van die tabel

A

AVG(de tabel)

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

optellen van die colom totaal

A

SUM(de tabel)

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

totaal aantal producten wat klantnummer 6 heeft gekocht in database items tabel name

A

SELECT COUNT(name) FROM items WHERE seller_id=6

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

bereken de algemene prijs waar klantnummer 6 producten voor heeft gekocht. tabel cost database name

A

SELECT AVG(cost) FROM items WHERE seller_id=6

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

toon van seller id 12 aantal producten, duurste product en algemene prijs product database items

A

SELECT COUNT(*) AS item_count,
MAX(cost AS max,
AVG(cost) AS avg
FROM items WHERE seller_id=12

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

toon een lijst met seller id en hoeveel producten die hebben gekocht

A

SELECT seller_id,COUNT(*) AS item_count FROM items GROUP BY seller_id

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

toon lijst met seller id en hoeveelheid producten gelijk of meer dan 3

A

SELECT seller_id, COUNT() AS item_count FROM items GROUP BY seller_id HAVING COUNT () >=3

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