C: \ mysql \ bin > MySQL - U Root - P
Enter password: ****
Welcome To The MySQL monitor. Commands End With ; Or \ G.
Your MySQL connection ID Is 4
Server version: 5.0 . 51B - Community - NT MySQL Community edition (GPL)
Type'Help;' Or '\ H' ForHelp. Type'\ C' ToClear the buffer.
MySQL > Show databases;
+ -- ------------------ +
| Database |
+ -- ------------------ +
| Information_schema |
| MySQL |
| Mytest |
| Tjtz |
| Tjtz_148280117 |
+ -- ------------------ +
5 Rows In Set ( 0.00 Sec)
MySQL> Create DatabaseMytest2;
Query OK,1Row affected (0.01Sec)
MySQL > Show databases;
+ -- ------------------ +
| Database |
+ -- ------------------ +
| Information_schema |
| MySQL |
| Mytest |
| Mytest2 |
| Tjtz |
| Tjtz_148280117|
+ -- ------------------ +
6 Rows In Set ( 0.00 Sec)
MySQL > Use Mytest2;
Database Changed
MySQL> Create Table Testtable (
-> ID Int ( 4 ) Auto_increment Not Null Primary Key ,
-> NameChar ( 10 ) Not Null ,
-> Address Char ( 50 ) Default ' Jinan ' ,
-> Year Date );
Query OK, 0 Rows affected ( 0.09 Sec)
MySQL > Show tables;
+ -- ----------------- +
| Tables_in_mytest2 |
+ -- ----------------- +
| Testtable |
+ -- ----------------- +
1 Row In Set ( 0.05 Sec)
MySQL> Insert IntoTesttableValues('','Zhangsan','','2011-12-29');
Query OK,1Row affected,1Warning (0.00Sec)
MySQL > Select * From Testtable;
+ -- -- + ---------- + --------- + ------------ +
| ID | Name | Address | Year |
+ -- -- + ---------- + --------- + ------------ +
| 1 | Zhangsan | | 2011 - 12 - 29 |
+ -- -- + ---------- + --------- + ------------ +
1 Row In Set ( 0.00 Sec)
MySQL> UpdateTesttableSetAddress='Jiefang Road';
Query OK,1Row affected (0.06Sec)
Rows matched:1Changed:1Warnings:0
MySQL > Select * From Testtable;
+ -- -- + ---------- + -------------- + ------------ +
| ID | Name | Address | Year |
+ -- -- + ---------- + -------------- + ------------ +
| 1 | Zhangsan | Jiefang Road | 2011 - 12 - 29 |
+ -- -- + ---------- + -------------- + ------------ +
1 Row In Set ( 0.00 Sec)
MySQL> Insert IntoTesttableValues('','Lisi',Null,'2012-1-3');
Query OK,1Row affected,1Warning (0.00Sec)
MySQL > Select * From Testtable;
+ -- -- + ---------- + -------------- + ------------ +
| ID | Name | Address | Year |
+ -- -- + ---------- + -------------- + ------------ +
| 1 | Zhangsan | Jiefang Road | 2011 - 12 - 29 |
| 2 | Lisi | Null | 2012 - 01 - 03 |
+ -- -- + ---------- + -------------- + ------------ +
2 Rows In Set ( 0.00 Sec)
MySQL>