184k views
1 vote
Display SupplierID and Phone of suppliers whose phone number, including area code, contains two and only two '0's. For example, supplier 11 should not appear in the output because its phone number (010) 9984510 contains three '0's.

Hint 1: correct output has three suppliers.
Hint 2: considering two LIKE operators.
Tables: Products, Categories, Suppliers

User Abder
by
4.8k points

1 Answer

3 votes

Answer:

Answer explained below

Step-by-step explanation:

since there is no table showing the columns, i will consider mobile as phone number and id as supplier id and code as area code.

the query is as follows

select id,mobile from suppliers where mobile like '%0%0%' and code like '%0%0%'.

here we have used two like operators i.e one for mobile and one for area code.

'%0%0%' means that the number should contain two zeros and positions can be wherever in the number.

User Karl Reid
by
4.0k points