I have got 10 tables in mysql all starting with uppercase, I was wondering if can change all of them to lowercase with one query rather than 20?
Asked
Active
Viewed 5,019 times
1 Answers
5
Check Amy Anuszewski answer
select concat('rename table ', table_name, ' to ' , lower(table_name) , ';')from information_schema.tables where table_schema = 'your_schema_name';

Ghostman
- 6,042
- 9
- 34
- 53
-
-
table_schema is the database name. To show also the databases without any tables: SELECT s. schema_name, t. table_name FROM INFORMATION_SCHEMA --- check this link https://dev.mysql.com/doc/refman/5.7/en/tables-table.html – Ghostman Jun 07 '17 at 09:30
-
this query redirected me to information_schema table but didn't change the table names – sasasasa Jun 07 '17 at 09:32
-