1

I need a SQL query to check table name in which case.(upper/lower) For example I have table name 'USER' so that query should return UPPERCASE or in the case of table name 'user' it should return lower case.

Amit Joshi
  • 35
  • 9

1 Answers1

1

You can use the below query to get whether the tables were created as upper/lower case.

SELECT 
    TABLE_NAME,
    CASE TABLE_NAME REGEXP BINARY '[a-z]'
        WHEN 1 THEN 'lower'
        ELSE 'upper'
    END AS case_status
FROM
    information_schema.TABLES
WHERE
    TABLE_SCHEMA = 'table_name';
James
  • 1,819
  • 2
  • 8
  • 21