Friday, May 26, 2006

SECTION 7
LESSON 1
1. What DJs on Demand cd titles were produced in any year before "Carpe Diem" was produced?

----selelct title
from d_cds
where year>all(select year from d_cds where title='Carpe Diem');

2. Write a query that returns jazz and pop songs. Write a multi-row subquery and use the d_songs and d_types tables. Include the id, title, duration, and the artist name.

----select id,duration,artist
from d_songs
where type_code=any(select code from d_types where description in('jazz,'pop'));

3. Find the DJs on Demand events whose cost was less than or equal to the low-range cost of package code 200?

----select name
from d_events
where cost=
4. Find the last names of all employees whose salaries are the same as the minimum salary for any department.

----select last_name
from employees
where salary=any(select min(salary) from employees group by department_id);

5. Which Global Fast Foods employee earns the lowest salary? Hint: You can use either a single-row or a multiple-row subquery.

----select first_name,last_name
from f_staffs
where salary=(select min(salary) from f_staffs group by id);

6. Place the correct multiple-row comparison operators in the outer query WHERE clause of each of the following:
a. Which CDs in our d_cds collection were produced before "Carpe Diem" was produced? WHERE year __>all____ (SELECT year ...
b. Which employees have salaries lower than any one of the programmers in the IT department?WHERE salary___c. What CD titles were produced in the same year as "Party Music for All Occasions" or "Carpe Diem"?WHERE year ___in_____(SELECT year ...
d. What song title has a duration longer than every type code 77 title?WHERE duration __>any___(SELECT duration ...

7. Which of the following are True? Each WHERE clause is from the outer query.
_T__a. WHERE size > ANY If the inner query returns sizes ranging from 8 to 12, the value 9 could be returned in the outer query.
_T__b. WHERE book_number IN If the inner query returns books numbered 102, 105, 437, and 225 then 325 could be returned in the outer query.
_F__c. WHERE score <= ALL If the inner query returns the scores 89, 98, 65, and 72, then 82 could be returned in the outer query.
_F__d. WHERE color NOT IN If the inner query returns red, green, blue, black, and then the outer query could return white.
_F__e. WHERE game_date = ANY If the inner query returns 05-JUN-97, 10-DEC-02, and 2-JAN-04, then the outer query could return 10- SEP-02.

8. The goal of the following query is to display the minimum salary for each department whose minimum salary is less than the lowest salary of the employees in department 50. However, the subquery does not execute because it has five errors. Find them, correct them, and run the query.SELECT department_idFROM employeesWHERE MIN(salary)HAVING IN(salary) >GROUP BY department_idSELECT MIN(salary)WHERE Dpartment_id < 50;

----select min(salary)
from employees
where min(salary)<(select min(salary) from employees where department_id=50);

9. Which statements are True about the subquery below?
SELECT employee_id, last_name
FROM employees
WHEREsalary =(SELECT MIN(salary)FROM employeesGROUP BY department_id);
__F___a. The inner query could be eliminated simply by changing the WHERE clause to WHERE MIN(salary).
__T_b. The query wants the names of employees who make the same salary as the smallest salary in any department.
____T_c. The query firsts selects the employee ID and last name, ad then compares that to the salaries in every department.
____F__d. This query will not execute.

10. Place an X next to those values that could be returned by the outer query if the inner query returned 185.98, 315.75, 382.24, and 877.31 with the following WHERE clause:WHERE total_sales < ANY__*_a. 155.22_____b. 325.88_____c. 877.30_____d. 382.24

40 Comments:

Blogger Henry Ruan said...

加油!

7:32 PM  
Blogger VirgilioMaillet said...

強姦巨乳彩繪模特兒後官入口後宮後宮片後宮com網站後宮bt後宮無碼光碟網後宮無碼情色光碟網後宮色情後宮限制級後宮處女後宮電後宮電院入口後宮視訊xvideo鴛鴦吧xvideo線上xo7777xmatch交友中心xmatch交友xh美色網xevdioxxes888x84ao4x693wwwyoutubecom成人wewet聊天室wd777netwatchshowtvvsbox色美媚入口國中正妹牆國中正妹照國中生情色小說國中生妹妹做愛國中生做愛國中生自拍論壇國中生自拍國中生聊天室國中生的禁事18國中生的禁事國際比基尼小姐視訊聊天國際比基尼小姐囡囡網站四級美女寫真嘟嚷

6:49 AM  
Blogger 睡衣 said...

很用心的blog,推推哦 ........................................

4:53 AM  
Blogger stargo said...

女優大奶性交性愛淫蕩淫慾淫亂淫婦淫妹淫叫淫水淫女情慾情色做愛限制級波霸口交18禁貼圖寫真視訊援交露點爆乳潮吹裸體裸照裸女愛愛無碼尋夢視訊聊天a漫

12:43 AM  
Blogger 宥軒 said...

台灣美女自拍寫真圖片夫妻自拍論壇學生妹做愛自拍學生妹做愛自拍照片學生妹做愛自拍影片台灣18情色文學網台灣18影片台南留言台南正妹無名台南元交只有成人貼圖區只有成人圖區只有貼途區只有圖區只有圖貼區台中人聊天(f1)台中人聊天室(f1)台中之都聊天室台中色情按摩台中聊天網台中援留言板台妹圖台南一夜留言台灣18線上影片台灣av女優免費看台灣女自拍台灣女星寫真圖片台灣少女線上自慰偷拍影片台灣文學小說台灣文學網小弟弟影片交流區 小弟弟影片區 美女遊戲情色自拍

3:37 AM  
Blogger 柏辰 said...

相見亦無事,不來常思君..................................................

6:15 PM  
Blogger 偉倫 said...

Nice blog85cc,咆哮小老鼠,85街,免費影片,情趣爽翻天,愛戀情人用品,交友找啦咧,線上a片,女同志聊天室,sexy,色情網站,網愛聊天室,情色性愛貼圖,小穴,性愛姿勢,陰脣室,成人圖貼,性愛技巧,a片論壇,色情,85c,sexy網,人妻,脫衣,6k,18禁,手淫,性幻想,77p2p,情色,1007,85c,0401,後宮,色情,淫蕩,正妹,77p2p,ut室

10:37 AM  
Blogger RafaelLetso21555 said...

Cool blog網愛聊天室色情網站交友找啦咧免費影片成人笑話成人圖庫sexy女同志聊天室愛戀情人用品情趣爽翻天咆哮小老鼠入口85cc6k脫衣人妻sexy85c脫光光taiwansex淫女情色成人男女做愛美女做愛脫衣秀a片正妹淫蕩色情後宮040185c85c77p2p77p2p性幻想手淫18禁

8:30 PM  
Blogger 逸凡逸凡 said...

以簡單的行為愉悅他人的心靈,勝過千人低頭禱告........................................

7:14 PM  
Blogger 雲亨 said...

憤怒,是片刻的瘋狂。..................................................

7:42 PM  
Blogger DamionHallam3216 said...

視訊美女聊天室戀愛ing聊天室視訊網愛免費影片分享視訊聊天交友elove無碼av女優,av成人網,台灣kiss情色貼圖彩虹情人視訊彩虹情人視訊交友網後宮視訊ol制服美女影片視訊交友cleansing78論壇av短片-免費a片yam交友浪漫月光論後宮電影院 色情影片成人情色文學成人情色文學走光人小說成人小說本土自拍18遊戲情色電影免費影片欣賞援交友留言主播情人視訊情色交友
主播情人視訊情色交友520sex視訊影音交友
520sex視訊影音交友彩虹情人視訊交友網
一對一辣妹影音視訊聊天室一對一辣妹影音視訊聊天室武則天影音視訊聊天室
武則天影音視訊聊天室淫娃免費視訊聊天室

7:31 PM  
Blogger 韋于倫成 said...

堅持是為著某種目的或目標,而持續不斷朝向既定方向努力的一種意念。 ..................................................

10:49 AM  
Blogger 韋于倫成 said...

A friend to everybody is a friend to nobody. ....................................................

1:08 PM  
Blogger 柏勳 said...

As a man sows, so he shall reap...................................................

3:55 AM  
Blogger 德慈美玉 said...

灰心是動搖的開端,動搖是失敗的近鄰。........................................

11:02 PM  
Blogger LeanneC珮瑜 said...

Never put off till tomorrow what may be done today.............................................................

12:26 AM  
Blogger SadeRa盈君iford0412 said...

此處是值得一探究竟的好部落格!!........................................

6:10 PM  
Blogger 洪筱婷 said...

看得見您的用心~~希望這裡愈來愈熱鬧哦~~.................................................................

6:29 AM  
Blogger 哲維維 said...

河水永遠是相同的,可是每一剎那又都是新的。......................................................................

12:46 AM  
Blogger 韻玉 said...

在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」....................................................................

10:14 AM  
Blogger 嘉琬嘉琬 said...

人不能像動物一樣活著,而應該追求知識和美德............................................................

12:35 AM  
Blogger 王名仁 said...

當一個人內心能容納兩樣相互衝突的東西,這個人便開始變得有價值了。............................................................

10:51 PM  
Blogger 芸茂芸茂 said...

不只BLOG內容很棒留言也很精采 XDDDD..................................................................

4:39 AM  
Blogger 天花天花 said...

文章是心情的反應~~祝妳天天寫的都是讓人開心的好文章哦!!............................................................

3:59 AM  
Blogger 1986/6/7 said...

部落格很棒唷~ 支持你歐^^..................................................................

6:00 PM  
Blogger 萱祥 said...

hello, i visited~~感謝大大分享..!..................................................................

12:03 AM  
Blogger 曾法幸 said...

好的blog值得一推再推,要愈來愈好哦!!!!............................................................

3:44 PM  
Blogger 思恬 said...

老天爺賦予了強者的能力,就是要他比弱者多擔待..................................................

12:20 AM  
Blogger 紹函紹函 said...

幸福沒有鑰匙,只有梯子。.................................................................

10:36 PM  
Blogger 劉士賢劉士賢 said...

愛,拆開來是心和受兩個字。用心去接受對方的一切,用心去愛對方的所有。......................................................................

8:02 PM  
Blogger 鄭美玉 said...

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull, Some have weird names , and all are different colors, but they all have to live in the same box .............................................................

8:16 PM  
Blogger 凱v胡倫 said...

真正仁慈的人,會忘記他們做過的善行,他們全心投入現在的工作,過去的事已被遺忘。.................................................

11:17 PM  
Blogger 亦奈美妮 said...

Never put off till tomorrow what may be done today..................................................................

9:16 PM  
Blogger 文王廷 said...

缺少智慧,就是缺少一切..................................................

2:19 PM  
Blogger 王辛江淑萍康 said...

這麼好的部落格,以後看不到怎麼辦啊!!!............................................................

11:51 PM  
Blogger 黃智樺黃智樺 said...

讓好心情回味發酵;壞心情留在文字裡隨時間消逝吧!............................................................

9:44 AM  
Blogger 幸平平平平杰 said...

相見亦無事,不來常思君......................................................................

8:23 AM  
Blogger 盛灵林 said...

感謝大大的無私分享 讓小弟獲益良多 終於知道網上還有這麼多的好東西≧▽≦"
............................................................

7:39 PM  
Blogger 王綺廖家堯廖家堯穎 said...

愛情是盲目的,但婚姻恢復了它的視力。......................................................................

12:12 AM  
Blogger 王雅俊 said...

人生就像一顆核桃,必須敲破它,才會顯出他的內容。..................................................... ............

2:09 PM  

Post a Comment

<< Home