创建数据库 查看所有数据库
使用 数据库
查看数据库中的表 (因为新建的数据库 所以目前没有)
show tables;
创建teacers表
现在在查看表
修改表-字段属性 (entry_datatime 的类型因为之前导入不了数据 所以改成了date)
查看表结构
创建students表关联teacers表中的id
添加数据到teacers表中,并查看表中数据
添加数据到students表中,并查看表中数据(只查看了id,name ,teacer_id)
因为students表中的 teacer_id 字段都有关联teacers表 所以重新添加了几条数据
students表以teacer_id做升序排列(order by ...asc)
查询:students表中 id小于5和name中以xiao开头,且teacer_id等于1
内关联(inner join ... on...)查询:(students中teacer_id)
左关联(left join ... on...):
右连接(right join ... on ...):
分页查询(limit start geshu):
data类型中timestamp 的使用 :可以不用穿值 自动生成 或者传null