刁蛮娇妻苏小妹1:简单的SQL语言怎么写

来源:百度文库 编辑:中科新闻网 时间:2024/04/27 20:48:26
5、写出下列要求的SQL语句
姓名 年龄 性别 选修课程
张三 20 男 数学
李四 21 女 计算机
张兰 20 女 英语
(1)、显示该表所有信息;
(2)、只显示该表中学生选修课程;
(3)、找出年龄小于21岁的学生姓名;
(4)、从该表中选出姓张的学生年龄;
(5)、让表格按照年龄的升序列排列;

1.select * from tablename;
2.selct 选修课程 from tablename;
3.select 姓名 from tablename where 年龄<21;
4.select 年龄 from tablename where 姓名 like "张%";
5.select * from tablename order by 年龄;

1.elect * from 表名;
2.selct 选修课程 from 表名;
3.select 姓名 from 表名 where 年龄<21;
4.select 年龄 from 表名 where 姓名 like "张%";
select * from 表名 where order by 年龄
注释说明排列顺序默认是升序的