1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| mysql> create table if not exists exam_score( -> id int(4) not null primary key auto_increment, -> name char(20) not null, -> score double(16,2)); Query OK, 0 rows affected, 2 warnings (0.09 sec)
mysql> show columns from exam_score; +-------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+----------------+ | id | int | NO | PRI | NULL | auto_increment | | name | char(20) | NO | | NULL | | | score | double(16,2) | YES | | NULL | | +-------+--------------+------+-----+---------+----------------+ 3 rows in set (0.04 sec)
mysql> insert into exam_score values (1,'zhao',95.55),(2,'qian',80.95),(3,'sun',70.10),(4,'li',60.20); #插入数据 Query OK, 4 rows affected (0.04 sec) Records: 4 Duplicates: 0 Warnings: 0
|