创建数据库  查看所有数据库

MySQL 实践命令(一)

使用 数据库

MySQL 实践命令(一)

查看数据库中的表 (因为新建的数据库 所以目前没有)

show tables;

创建teacers表

MySQL 实践命令(一)

现在在查看表

MySQL 实践命令(一)

修改表-字段属性 (entry_datatime 的类型因为之前导入不了数据 所以改成了date)

MySQL 实践命令(一)

查看表结构

MySQL 实践命令(一)

创建students表关联teacers表中的id

MySQL 实践命令(一)

添加数据到teacers表中,并查看表中数据

MySQL 实践命令(一)

添加数据到students表中,并查看表中数据(只查看了id,name ,teacer_id)

MySQL 实践命令(一)

因为students表中的 teacer_id 字段都有关联teacers表 所以重新添加了几条数据

MySQL 实践命令(一)

MySQL 实践命令(一)

students表以teacer_id做升序排列(order by ...asc)

MySQL 实践命令(一)

查询:students表中 id小于5和name中以xiao开头,且teacer_id等于1

MySQL 实践命令(一)

内关联(inner join ... on...)查询:(students中teacer_id)

MySQL 实践命令(一)

左关联(left join ... on...):

MySQL 实践命令(一)

右连接(right join ... on ...):

MySQL 实践命令(一)

分页查询(limit start geshu):

MySQL 实践命令(一)

data类型中timestamp 的使用 :可以不用穿值 自动生成  或者传null

MySQL 实践命令(一)

相关文章:

  • 2021-08-27
  • 2022-12-23
  • 2021-10-23
  • 2021-06-17
  • 2022-01-28
  • 2022-01-05
  • 2021-05-13
  • 2021-07-06
猜你喜欢
  • 2021-10-14
  • 2021-07-26
  • 2022-12-23
  • 2021-08-20
  • 2021-10-11
  • 2021-07-24
相关资源
相似解决方案