21 tm 25 Flashcards

1
Q

welke sellers kochten allemaal boxes of frogs? tabel items

A

select seller_id from items where name like ‘%boxes of frogs’

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

toon de naam en de minimale prijs van boxes of frogs van de sellers 68,6,18

A

select name, min(cost) from items where name like ‘%boxes of frogs’ AND seller_id IN (68,6,18)

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

subquery welke verkopers verkopen boxes of frogs voor welke prijs

A

select name, min(cost) from items where name like ‘%boxes of frogs’ and seller _id IN(
select seller_id from items where name like ‘%boxes of frogs’ )

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

nieuwe custom tabel gecombineerd uit meerdere databases

A

select customer.id, customer.name, items.name, items.cost

from customers,items

where customer.id=seller_id ORDER BY customer.id

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

query gecombineerd uit items en customers tabel

A

SELECT i.seller_id, i.name, c.id FROM customers AS c, items AS i WHERE i.seller_id=c.id

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

toon alle customers die iets gekocht hebben

A

select customers.name, items.name FROM customers LEFT OUTER JOIN items ON customers.id=seller_id

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

unions

name cost bids

2 query’s tegerlijk uitgevoerd

A

SELECT name, cost, bids FROM items WHERE bids>190

UNION (ALL)

SELECT name, cost, bids FROM items WHERE cost>1000

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

zoek alle items met het woord baby in de tabel name

A

SELECT name, cost FROM items WHERE match(name) against (‘baby’) (+/- voor baby voor (not)include)

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