![]() |
||
|
Major Member
![]() 加入日期: Nov 2004 您的住址: 高雄
文章: 276
|
哪裡可找到SQL練習題庫、資料庫?
最近從SQL重新學起
發現很多語法並沒那麼難懂 虛心真的是學習路上很重要的一種心態... 目前用oracle 11g r2 內建的HR資料庫沒甚麼東西可以用 想請問是否適合練習用的資料,而且可以匯入自己電腦上的oracle裡? 如果有相關的問題就更好 另外想請問是否還有類似SQLZoo這樣的互動式SQL練習網站? 10月份會開始上認證機構的OCP課程 想先自修的話 是否有建議的順序?
__________________
![]() It's when you start to become really afraid of death, that you learn to appreciate life. [Leon] |
|||||||
|
|
|
Basic Member
加入日期: Apr 2005 您的住址: 台灣
文章: 12
|
引用:
http://blog.csdn.net/null____/article/details/8521058 這個題目我覺得不錯 , 可以做做看
__________________
int 一定會中樂透函數(void) { int result=一定會中(); char get[15]; if (result) { 取得樂透號碼(get); printf(" 本期樂透號碼:%s \n",get); return true; }else { 求求你讓我中(); 一定會中樂透函數(); } return false; } |
|||
|
|
|
*停權中*
加入日期: May 2013
文章: 9
|
引用:
到 O'Reilly 找 Example 就很多了 |
|
|
|
|
Major Member
![]() 加入日期: Nov 2004 您的住址: 高雄
文章: 276
|
引用:
帥 很符合需求,謝謝 引用:
謝謝。應該不需要買書吧 ![]()
__________________
![]() It's when you start to become really afraid of death, that you learn to appreciate life. [Leon] |
||
|
|
|
Major Member
![]() 加入日期: Nov 2004 您的住址: 高雄
文章: 276
|
http://sqlzoo.net/wiki/SELECT_within_SELECT_Tutorial
網頁內第8題,順便問一下這題,資料表格在網頁內 限定用nested SELECT回答 問Some countries have populations more than three times that of any of their neighbours (in the same continent). Give the countries and continents. 各大陸中,某些國家有著比位於該大陸內的其他任何國家多3倍以上的人口, 試問是那些國家及其大陸? 我的解題邏輯是 1. 該國家一定是該大陸最多人口的國家 2. 該大陸中沒有一個國家(除了該國)的人口比該國的1/3人口多 3. 找出符合步驟2.條件的大陸 4. 找出步驟3.的大陸中的最多人口的國家 我的解法是 代碼:
--條件: 1) 該大陸中,人口超過該大陸最多人口1/3的國家數只有1個,的大陸
-- 2) 該國家人口=該大陸最多MAX人口的國家
--找出國家名稱及其所在大陸
SELECT w3.name, w3.continent
FROM (
--找出各大陸中人口超過該大陸最多人口的1/3的國家數
--(各大陸名稱,超過該大陸MAX人口之1/3的國家數,MAX人口)
SELECT continent, COUNT(*) AS cnt, max_popu
FROM (
--找出各大陸最多人口(各大陸名稱,MAX人口)
SELECT continent, MAX(population) 'max_popu'
FROM world
GROUP BY continent
)
AS w2, world w
WHERE (w.continent=w2.continent) AND
(w.population>ROUND(w2.max_popu/3))
GROUP BY w.continent
)
AS cntEachCtnt, world w3
WHERE (cntEachCtnt.cnt=1) AND
(w3.population=cntEachCtnt.max_popu);
不知道有沒有人有更漂亮的解法?
__________________
![]() It's when you start to become really afraid of death, that you learn to appreciate life. [Leon] 此文章於 2013-09-14 10:32 AM 被 嚐起來像雞 編輯. |
|
|