해머를 이용해서 TPCH 데이터 베이스를 생성 한 후에 제대로 만들어졌는지 확인을 위하여 다음과 같은 명령어들을 수행해 봤는데 .....
데이터 조회가 안된다. 문제는 .... 테이블명을 대/소 문자 가린다. MySQL이 ....
mysql> show databases ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| tpch |
+--------------------+
5 rows in set (0.00 sec)
mysql> use tpch
Database changed
mysql> show tables ;
+----------------+
| Tables_in_tpch |
+----------------+
| CUSTOMER |
| LINEITEM |
| NATION |
| ORDERS |
| PART |
| PARTSUPP |
| REGION |
| SUPPLIER |
+----------------+
8 rows in set (0.01 sec)
mysql> describe CUSTOMER ;
+--------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------------+------+-----+---------+-------+
| C_CUSTKEY | int(11) | NO | PRI | NULL | |
| C_MKTSEGMENT | char(10) | YES | | NULL | |
| C_NATIONKEY | int(11) | YES | MUL | NULL | |
| C_NAME | varchar(25) | YES | | NULL | |
| C_ADDRESS | varchar(40) | YES | | NULL | |
| C_PHONE | char(15) | YES | | NULL | |
| C_ACCTBAL | decimal(10,2) | YES | | NULL | |
| C_COMMENT | varchar(118) | YES | | NULL | |
+--------------+---------------+------+-----+---------+-------+
8 rows in set (0.00 sec)
mysql> SELECT count(*) from customer ; <-- 대소문자 가림 --;
ERROR 1146 (42S02): Table 'tpch.customer' doesn't exist
mysql> SELECT count(*) from CUSTOMER ;
+----------+
| count(*) |
+----------+
| 150000 |
+----------+
1 row in set (0.00 sec)
mysql> SELECT DISTINCT TABLE_NAME, INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = 'tpch';
+------------+----------------+
| TABLE_NAME | INDEX_NAME |
+------------+----------------+
| CUSTOMER | PRIMARY |
| CUSTOMER | CUSTOMER_FK1 |
| LINEITEM | PRIMARY |
| LINEITEM | LINEITEM_FK2 |
| LINEITEM | LINEITEM_FK3 |
| LINEITEM | LI_SHP_DT_IDX |
| LINEITEM | LI_COM_DT_IDX |
| LINEITEM | LI_RCPT_DT_IDX |
| NATION | PRIMARY |
| NATION | NATION_FK1 |
| ORDERS | PRIMARY |
| ORDERS | ORDERS_FK1 |
| ORDERS | ORDERS_DT_IDX |
| PART | PRIMARY |
| PARTSUPP | PRIMARY |
| PARTSUPP | PARTSUPP_FK2 |
| REGION | PRIMARY |
| SUPPLIER | PRIMARY |
| SUPPLIER | SUPPLIER_FK1 |
+------------+----------------+
19 rows in set (0.00 sec)
mysql> show index from customer ; <--- 소문자 안되요 ~~~
ERROR 1146 (42S02): Table 'tpch.customer' doesn't exist
mysql> show index from CUSTOMER ;
+----------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+----------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| CUSTOMER | 0 | PRIMARY | 1 | C_CUSTKEY | A | 150000 | NULL | NULL | | BTREE | | |
| CUSTOMER | 1 | CUSTOMER_FK1 | 1 | C_NATIONKEY | A | 25 | NULL | NULL | YES | BTREE | | |
+----------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.00 sec)