든 객체는 뷰입니다. 다양한 테이블과 뷰의 구조를 보여주는 방법으로 이 책의 여러 장에 걸쳐
설명했던
describe
유틸리티와 달리,
information
_
schema
내의 뷰를 쿼리하여 프로그래밍
방식으로 사용할 수 있습니다(이 장의 뒷부분에서 자세히 설명합니다). 다음은 샤키라 데이터
베이스의 모든 테이블의 이름을 검색하는 방법을 보여주는 예제입니다.
mysql> SELECT table_name, table_type
-> FROM information_schema.tables
-> WHERE table_schema = 'sakila'
-> ORDER BY 1;
+----------------------------+------------+
| TABLE_NAME | TABLE_TYPE |
+----------------------------+------------+
| actor | BASE TABLE |
| actor_info | VIEW |
| address | BASE TABLE |
| category | BASE TABLE |
| city | BASE TABLE |
| country | BASE TABLE ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.