MySQL语法练习
select dname,lower(dname) from dept
select dname,lower(dname),upper(dname) from dept
select dname,length(dname),loc,length(loc) from dept
SELECT dname,SUBSTR(dname,2) from dept
SELECT dname,SUBSTR(dname,2,5) from dept
select dname,concat(dname,'hello') from dept
select dname,replace(dname,'a','666') from dept
select comm,ifnull(comm,0) from emp
select now(),year(now()),month(now()),day(now())
select now(),hour(now()),minute(now()),second(now())
select * from dept where loc='二区' and dname='research'
select deptno from dept where loc='二区' and dname='research'
select * from dept where loc='一区' or deptno=3
select count(1),tname from teachers
where tsex='男'
group by tname
select * from students where ssex='女'
select sname,count(1) from students
where ssex='女'
group by class
having count(1)> 1
select * from students order by sbirthday
select min(sbirthday),max(sbirthday) from students
select * from students where year(sbirthday) <
( select avg( year(sbirthday) ) from students )
limit 0,1