Need help to solve this question in SQL? Get the first name, city, country, and invoiced amount of customers living either in country Brazil or in city Paris and with a total invoice greater than $38. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Need help to solve this question in SQL? Get the first name, city, country, and invoiced amount of customers living either in country Brazil or in city Paris and with a total invoice greater than $38.

14th Jul 2016, 1:43 AM
Rosekamal
12 Answers
+ 5
SELECT column_list FROM customers WHERE amount >= 38 AND (city = 'Paris' OR country = 'Brazil');
15th Jul 2016, 1:11 AM
K Crage
+ 2
Select fname,city,country,amount from table1 where country='brazil' or city ='paris' and amount›38
14th Jul 2016, 3:34 AM
ashwath nm
ashwath nm - avatar
0
Select first name, city, country, invoiced amount from customers where country = 'Brazil' or city ='paris' and Invoiced amount > 38
16th Jul 2016, 2:50 PM
sun
0
that worked! I was making syntax error country= . still getting to be comfortable with and or. thanks folks!
16th Jul 2016, 2:52 PM
Rosekamal
0
@Rosekamal Don't forget to use parenthesis when nesting or you may end up with a results table that could cause you some headaches.
16th Jul 2016, 3:05 PM
K Crage
0
select first name,city,country,invoiced amount from customers where country = 'Brazil' or 'city Paris' AND total invoice > $38
16th Jul 2016, 8:25 PM
Dev_140897
Dev_140897 - avatar
0
@K Crage - yea, it took me a while to get used to ordering AND OR with Parenthesis. that's a wise suggestion!
17th Jul 2016, 4:58 AM
Rosekamal
0
select firstname,city,country,invoice from customers where(country='Brazil' or city='Paris') and MAX(invoice)>38;
18th Jul 2016, 12:33 PM
Rajnil Guha
0
how many tables are their? do all these columns exists in same table?
23rd Jul 2016, 4:51 PM
Saurabh Joshi
Saurabh Joshi - avatar
0
select firstname,city,country,invoiced_amt from customers where country='Brazil' or city='Paris' and invoiced _amt>38
25th Jul 2016, 7:33 PM
kannu priya
kannu priya - avatar
0
SELECT fname, city, country, invoice FROM customerTable WHERE (city = 'Paris' OR country = 'Brazil') AND invoice >= 39;
27th Jul 2016, 9:34 PM
wheeler
- 2
SELECT first name, city, country FROM column list WHERE (country = 'Brazil' or city ='Paris' AND invoiceAmount > $38);
27th Jul 2016, 7:32 PM
Dorbor H. Richards Jr.
Dorbor H. Richards Jr. - avatar