๋ชฉ์ฐจ
Mysql/MariaDB ํ ์ด๋ธ ์กฐํ
information_schema DB๋ฅผ ํ์ฉ(์ ๋ information_schema์ ์ ๋ณด๋ฅผ ์์ ํ๋ฉด ์๋จ)
Mysql ํน์ MariaDB์ ๋ฉํ๋ฐ์ดํฐ ์ ๋ณด๋ฅผ ๋ด๊ณ ์๋ information_schema๋ฅผ ํ์ฉํด์
๋ค์ํ๊ฒ ์ฌ์ฉ ๊ฐ๋ฅ(๋น ํ ์ด๋ธ ์กฐํ ๋ฑ)

-- ๋น ํ
์ด๋ธ ์กฐํ
SELECT
TABLE_NAME AS ํ
์ด๋ธ๋ช
,
table_comment AS ์ฝ๋ฉํธ,
table_rows AS ํ
FROM information_schema.tables
WHERE
table_schema = '์คํค๋ง๋ช
'AND table_rows <= 0;
-- ์ปฌ๋ผ์ผ๋ก ํ
์ด๋ธ ์กฐํ
SELECT
TABLE_SCHEMA
,TABLE_NAME
,COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='์ปฌ๋ผ๋ช
';

'IT > DataBase' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [MySQL/MariaDB]๋ฌธ์์ด ๋ถ์ด๊ธฐ(concat, concat_ws) (0) | 2022.11.25 |
|---|---|
| [MySQL/MariaDB]'ํ ์ด๋ธ๋ช ' doesn't exist (0) | 2022.11.23 |
| [Cubrid]์์คํ ์นดํ๋ก๊ทธ(ํ ์ด๋ธ, ์ปฌ๋ผ ์กฐํ) (0) | 2022.11.22 |
| [MySQL/MariaDB] Column 'xx' in where clause is ambiguous ์๋ฌ (0) | 2022.11.22 |
| [MySQL/MariaDB] merge(๊ฐ์ด ์์ผ๋ฉด update, ์๋๋ฉด insert)(feat. ON DUPLICATE KEY UPDATE...) (0) | 2022.11.22 |
๋๊ธ