Friday, March 21, 2014

MySQL Commands

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sbtest             |
| test               |
| tpcc1000           |
+--------------------+

mysql> use tpcc1000;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> show tables;
+--------------------+
| Tables_in_tpcc1000 |
+--------------------+
| customer           |
| district           |
| history            |
| item               |
| new_orders         |
| order_line         |
| orders             |
| stock              |
| warehouse          |
+--------------------+
9 rows in set (0.00 sec)






mysql> describe customer;
+----------------+---------------+------+-----+---------+-------+
| Field          | Type          | Null | Key | Default | Extra |
+----------------+---------------+------+-----+---------+-------+
| c_id           | int(11)       | NO   | PRI | NULL    |       |
| c_d_id         | tinyint(4)    | NO   | PRI | NULL    |       |
| c_w_id         | smallint(6)   | NO   | PRI | NULL    |       |
| c_first        | varchar(16)   | YES  |     | NULL    |       |


mysql> select * from customer  (dump the entire table)
mysql> select * from customer where c_first='3YXhzppuJ02l1K1T';

No comments:

Post a Comment