1. sqld的编辑窗口,
use mysql
show databases; 展示所有的数据库
use database 名字; 使用指定的某个数据
show tables; 展示表格
查看表格
select * from 表名;
修改表格
update 表名 set 字段名 = value where 条件;
删除表格
delete from 表名;
删除表格(包含表结构)
drop 表名;
example:
查询成绩小于 60 分的科目
select c.* from course c, student s, score sc where s.sid = c.sid and sc.sid = c.sid and sc.score > 60;
左右查询:
左查询:
select a.*, b.* from aa a left join bb b on a.id = b.id having 条件;
右查询:
select a.*, b.* from aa a right join bb b on a.id = b.id having 条件;