Tables
Table 1: Suppliers
SupplierID |
SupplierName |
ContactName |
Address |
City |
PostalCode |
Country |
Phone |
6 |
Mayumi’s |
Mayumi Ohno |
92 Setsuko Chuo-ku |
Osaka |
545 |
Japan |
(06) 431-7877 |
10 |
Refrescos Americanas LTDA |
Carlos Diaz |
Av. das Americanas 12.890 |
São Paulo |
5442 |
Brazil |
(11) 555 4640 |
15 |
Norske Meierier |
Beate Vileid |
Hatlevegen 5 |
Sandvika |
1320 |
Norway |
(0)2-953010 |
Table 2: Products
ProductID |
ProductName |
SupplierID |
CategoryID |
Unit |
Price |
13 |
Konbu |
6 |
8 |
2 kg box |
6 |
14 |
Tofu |
6 |
7 |
40 – 100 g pkgs. |
23.25 |
24 |
Guaraná Fantástica |
10 |
1 |
12 – 355 ml cans |
4.5 |
33 |
Geitost |
15 |
4 |
500 g |
2.5 |
Query
If you need a place to try this query, try here: https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in
SELECT SupplierName FROM Suppliers WHERE EXISTS ( SELECT ProductName FROM Products WHERE SupplierId = Suppliers.supplierId AND Price < 7 );
Result
SupplierName |
Mayumi’s |
Refrescos Americanas LTDA |
Norske Meierier |
© 2019, Alejandro G. Carlstein Ramos Mejia. All rights reserved.