Which of the following will display the 'custname' (name of the customers) in lowercase and 'address' in uppercase from a table CUSTOMER?
Which of the following will display the 'custname' (name of the customers) in lowercase and 'address' in uppercase from a table CUSTOMER?
Solution
✅ Correct Option: 2
SQL's string functions are LOWER() (or LCASE()) to convert text to lowercase and UPPER() (or UCASE()) to convert text to uppercase. So SELECT LOWER(custname), UPPER(address) from CUSTOMER; is the valid query.
Options 1, 3 and 4: LOWERCASE() and UPPERCASE() are not SQL functions, so any query using them gives an error. These names are a common trap because they sound natural.
Related questions:
2025: 13 May Shift 2
2025: 3 June Shift 2