5. Filtering Data Flashcards

(8 cards)

1
Q

Retrieve all customers who are not from Germany.

A
select * from customers
where country <> 'Germany';
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Retrieve all customers with a score not less than 500.

using NOT operator

A
select * from customers
where NOT score < 500;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Retrieve all customers whose score falls in the range between 100 and 500

(inclusive of boundary values)

A
select * from customers where
score between 100 and 500;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Retrieve all customers living in either US, India or England

A
select * from customers
where country IN ('US', 'India', 'England');
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Retrieve names of customers starting with ‘M’

A
select * from customers
where name like 'M℅'
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Retrieve names of customers whose names end with ‘in’.

A
select * from customers where
name like '℅in'
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Find all customers whose name contains ‘r’

A
select * from customers where
name like '℅r℅'
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Find all customers whose name has ‘r’ in the 3rd position.

A

select * from customers where
name like ‘__r%’

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