我在这里: 首页 ? 面试试题 ? 浏览文章: 招聘数据库DBA职位的SQL Server面试题二
« C/C++面试题(附答案)公务员面试题每日十题(第十七天) »

招聘数据库DBA职位的SQL Server面试题二




内容摘要:知名外企招聘数据库DBA职位时采用的SQL Server面试题,附有解析哦。
关键词:SqlServer面试题  数据库面试题  
本文地址:http://www.teecool.com/post/2008041501.html
内容正文:

Question 7: Can you tell me what the difference of two SQL statements at performance of execution?
Statement 1:

 程序代码
if NOT EXISTS ( select * from publishers where state = 'NY')
begin
Select 'Sales force needs to penetrate New York market'
end
else
begin
Select 'We have publishers in New York'
end
Statement 2:
if EXISTS ( select * from publishers where state = 'NY')
begin
Select 'We have publishers in New York'
end
else
begin
Select 'Sales force needs to penetrate New York market'
end

Answer 7:不同点:执行时的事务数,处理时间,从客户端到服务器端传送的数据量大小

Question8: How can I list all California authors regardless of whether they have written a book?
In database pubs, have a table authors and titleauthor , table authors has a column state, and titleauhtor have books each author written.
CA behalf of california in table authors.
Answer 8:
select * from  authors where state='CA'

Question9: How can I get a list of the stores that have bought both 'bussiness' and 'mod_cook' type books?
In database pubs, use three table stores,sales and titles to implement this requestment.
Now I want to get the result as below:
stor_id stor_name                               
------- ----------------------------------------

7896    Fricative Bookshop



Answer 9:

 程序代码
select distinct a.stor_id, a.stor_name from stores a,sales b,titles c
where a.stor_id=b.stor_id and b.title_id=c.title_id and c.type='business' and
exists(select 1 from sales k,titles g where stor_id=b.stor_id
and k.title_id=g.title_id and g.type='mod_cook')

招聘数据库DBA职位的SQL Server面试题二一文有面试题库网收集自互联网,并非本站原创,如原作者发现招聘数据库DBA职位的SQL Server面试题二一文,请及时告知本站,本站会作出相关处理,谢谢!!!(联系方式:百度空间留言)

最近发表