SELECT CONCAT('DROP TABLE IF EXISTS `', TABLE_SCHEMA, '`.`', TABLE_NAME, '`;')
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = '___DB_NAME___';
2.생성한 database 의 모든 Table 을 빈(empty)상태로 만들기
SELECT CONCAT('DELETE FROM `', TABLE_SCHEMA, '`.`', TABLE_NAME, '`;')
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = '___DB_NAME___';
3.database 내의 table 개수 확인
SELECT COUNT(*)
FROM information_schema.TABLES
WHERE table_schema = '___DB_NAME___';
4.database의 모든 table의 row의 합 - Total DB row count
SELECT SUM(table_rows) AS 'Total DB row Count'
FROM information_schema.TABLES
WHERE 1=1
AND TABLE_SCHEMA = '___DB_NAME___'
5.database의 모든 table의 상세정보
SELECT *
FROM information_schema.TABLES
WHERE 1=1
AND TABLE_SCHEMA = '___DB_NAME___'
ORDER BY table_rows
댓글 없음:
댓글 쓰기