首页 文章 MySQL语法练习

MySQL语法练习

2021-07-15 17:13  浏览数:627  来源:程序猿    

select dname from dept
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



声明:以上文章均为用户自行添加,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。

字符:    改为:
去打字就可以设置个性皮肤啦!(O ^ ~ ^ O)