



























有一个表叫Student, 含有以下字段:id, classid, name, birth, remark
1. 插入一条记录:classid=2 name=张三 birth=1982-07-19;
答案:insert into student (classid, name, birth) values(2, '张三', '1982-07-19')
2. 选出所有classid=4的学生;
答案:select * from student where classid=4
3. 查询所有班级出生年月大于1976的人;
答案:select * from student where birth>'1976'
4. 查询每个班级出生年月大于1976的人数;
答案:select classid, count(*) as number from student where birth>'1976' group by classid
5. 查询所有班级人数;
答案:select classid, count(*) as total from student group by classid
6. 查询所有REMAK中含有“计划”的记录;
答案:select * from student where remark like '%计划%'
7. 如果提高SQL的效率;
答案:在ASP中,
其他方面:
8. 代码实现打印扬辉三角形;
答案:
Code
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。