List the customer number and name for all customers located in the city of Grove. Your query should ignore case. For example, a customer with the city Grove should be included as should customers whose city is GROVE, grove, GrOvE, and so on.

Can someone explain if I am doing this correctly. Thanks

My Answer:

SELECT CUST_NUM, CUST_NAME
FROM CUSTOMER
WHERE UPPER (CITY) = UPPER(GROVE);

Recommended Answers

All 2 Replies

Hello Taino,

Your query is right! :-), well almost

where UPPER(CITY) = 'GROVE'; is the only correction. alternatively, you could use the 'Lower' function

where LOWER(CITY) = 'grove';

Try this also:
select cust_num, cust_name from customer where upper(city) = upper ('grove');

@Taino - In your query, when you do not place single quotes around the string, SQL will intrepret that as column name rather than a string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.