Final answer:
To list all records containing any variation of 'Houston' in a sales database, use SELECT with a LIKE clause. To update lowercase 'houston' to 'Houston', an UPDATE statement with REPLACE and LIKE is used.
Step-by-step explanation:
To list all values for Houston, whether capitalized or not, you can use the following SQL code:
SELECT * FROM sales WHERE city LIKE '%houston%';
To update lowercase instances of 'houston' to 'Houston', the SQL script would be:
UPDATE sales SET city = REPLACE(city, 'houston', 'Houston') WHERE city LIKE '%houston%';
It's important to note that the use of wildcards(%) in the LIKE clause allows you to find any occurrence of 'houston', even if it is part of a larger string or if there are characters before or after it.
The SQL code to list all values for Houston, capitalized or not capitalized, would be:
SELECT * FROM sales WHERE city = 'Houston' OR city = 'houston';
To update all lowercase instances of 'houston' to 'Houston', you can use the UPDATE statement:
UPDATE sales SET city = 'Houston' WHERE city = 'houston';
It's important to note that the use of WHERE id=is not permitted in this case, so we are using the city column directly instead.