insert into 表名 values (字段值);
insert into 表名(字段名) values (字段值);
update 表名 set 字段=‘值’ where 条件;
delete from 表名 where 条件;
select avg(字段名) as 值命名 from 表名;
select
字段名 from 表名 where
count > (select avg(字段名) as 值命名 from 表名);
count
select count(字段名) from 表名 where 条件;
select count(*) from 表名 where 条件;
select count(distinct 字段名) from 表名;
select 字段名,sum(表名.字段名) as 命名
from 表名 group by 字段名;
having
SELECT Websites.name, SUM(access_log.count) AS nums FROM Websites
INNER JOIN access_log ON Websites.id=access_log.site_id WHERE
Websites.alexa < 200 GROUP BY Websites.name HAVING
SUM(access_log.count) > 200;