MySQL常用命令行
# 创建表
create table tb2(
id bigint not null auto_increment primary key,
salary int,
age tinyint
)default charset=utf8;
# 插入数据
insert into tb2(salary,age) values(10000,18);
insert into tb2(salary,age) values(20000,28);
insert into tb2(salary,age) values(30000,38),(40000,40);
# 查看表中数据
select * from tb2;
show tables from gx_day14;
desc tb2;
+--------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+---------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| salary | int | YES | | NULL | |
| age | tinyint | YES | | NULL | |
+--------+---------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
select * from tb2;
mysql> select * from tb2;
+----+--------+------+
| id | salary | age |
+----+--------+------+
| 1 | 10000 | 18 |
| 2 | 20000 | 28 |
| 3 | 30000 | 38 |
| 4 | 40000 | 40 |
+----+--------+------+
4 rows in set (0.00 sec)
网友评论