美文网首页
MySQL常用命令行

MySQL常用命令行

作者: 火卫控 | 来源:发表于2023-04-28 18:44 被阅读0次

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)

相关文章

网友评论

      本文标题:MySQL常用命令行

      本文链接:https://www.haomeiwen.com/subject/tmswjdtx.html