mysql> show databases; +----------+ | database | +----------+ | mysql |
| test | +----------+ 3 rows in set (0.00 sec)
mysql> create table mytable (name varchar(20), sex char(1), -> birth date, birthaddr varchar(20));
query ok, 0 rows affected (0.00 sec)
mysql> show tables; +---------------------+ | tables in menagerie | +---------------------+ | mytables
| +---------------------+
6、 往表中加入记录mysql> describe mytable; +-------------+-------------+------+-----+---------+-------+
| field | type | null | key | default | extra |
+-------------+-------------+------+-----+---------+-------+
| name | varchar(20) | yes | | null | | | sex | char(1)
| yes | | null | | | birth | date | yes | | null | |
| deathaddr | varchar(20) | yes | | null |
| +-------------+-------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
mysql> insert into mytable -> values (′abccs′, ′f′,′1977-07-07′,′china′); query ok,
1 row affected (0.05 sec)
abccs f 1977-07-07 china mary f 1978-12-12 usa tom m 1970-09-02 usa
新闻热点
疑难解答