惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

博客园 - Fernando

div 图片垂直居中问题 连续字符自动换行的解决方案 border: none 0 如何使用fiddler在firefox下通过2层代理调试网页 CSS hacks *:first-child+html CSS Hack 【代码美化】CSS代码格式化和JS代码格式化工具 Fiddler的几个使用技巧 如何直接调试线上页面的JavaScript和CSS 敏捷软件开发模型--SCRUM 第一章:逻辑与证明 第九城市 Cognizant 高知特 上海瑞润电子科技有限公司 上海梵科信息科技有限公司 上海蓝矩信息科技有限公司 C# 中的委托和事件详解 关于Session_End()运行机制的一些细节! 无法打开 open a new function library
班库(上海)商务咨询有限公司
Fernando · 2008-08-30 · via 博客园 - Fernando

有一个表叫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中,

  • 使用JOIN写复杂的SQL语句代替一堆SQL语句:一次查询出所有数据;
  • 使用UPDATE语句代替rs.update();
  • 采用批量处理SQL语句比一句一句执行的效率高;
  • where子句中首先考虑索引;
  • 避免使用TEXT等大的字段:数据库大执行效率也大;

其他方面:

  • 使用内嵌视图代替临时表:临时表会消耗大量内存以及进行大量I/O操作;
  • 避免使用LEFT JOIN与NULL值,用INNER JOIN,并设置字段不能为NULL;
  • 使用索引;
  • 使用分区视图;
  • 使用触发器跑存储过程到另外一张统计表里;

8. 代码实现打印扬辉三角形;

答案:

Code