SQL1-ch7 集合運算 1. 題號  80 題: 50 、 55 、 62  140 題: 41 、 61 、 134 2.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

SQL – Lesson II Grade 12.
Using the Set Operators
0 - 0.
ALGEBRAIC EXPRESSIONS
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Sorting Rows. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –Construct a query to sort a results set in ascending.
© Abdou Illia MIS Spring 2014
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Joins and Sub-queries in SQL.
SQL2-ch2 管理綱要物件.
Displaying Data from Multiple Tables
O X Click on Number next to person for a question.
Past Tense Probe. Past Tense Probe Past Tense Probe – Practice 1.
Addition 1’s to 20.
25 seconds left…...
Test B, 100 Subtraction Facts
11 = This is the fact family. You say: 8+3=11 and 3+8=11
Week 1.
O X Click on Number next to person for a question.
Installment 7 Tables With No Column Presented by rexmen 2001 資管所.林彥廷.
SQL2-ch1 控制使用者存取. 題號  80 題: 14 、 22 、 40 、 42 、 52  140 題: 9 、 40 、 103.
SQL1-ch2 限制和排序資料. 考古題題號  80 題: 27 、 51  140 題: 23 、 58 、 70.
SQL1-ch11 使用資料說明視觀表 (Data Dictionary) 管理物件. 題號  80 題: 6 、 64  140 題: 105.
Divide-and-Conquer. 什麼是 divide-and-conquer ? Divide 就是把問題分割 Conquer 則是把答案結合起來.
學習C++的基本語法 認識關鍵字與識別字的不同 學習程式碼偵錯的流程 學習如何提高程式的可讀性
:Word Morphing ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10508:word morphing 解題者:楊家豪 解題日期: 2006 年 5 月 21 日 題意: 第一行給你兩個正整數, 第一個代表下面會出現幾個字串,
1 Q10276: Hanoi Tower Troubles Again! 星級 : ★★★ 題組: Online-judge.uva.es PROBLEM SET Volume CII 題號: Q10276: Hanoi Tower Troubles Again! 解題者:薛祖淵 解題日期: 2006.
Section 1.2 Describing Distributions with Numbers 用數字描述分配.
“Rule” By OX. By Check CREATE TABLE 員工薪資 ( 編號 int IDENTITY PRIMARY KEY, 薪資 smallmoney, CHECK ( 薪資 > 0 AND 薪資
BY OX. 檢視表與資料表的差異性 查詢 (query) 檢視表 (View) 的紀錄,是經由查詢 (query) 而來,而檢 視表的資料來源可以是單一資料表或是多資料表,甚 至其他檢視表 但檢視表中的紀錄只存在資料表中.
: Boxes ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11003: Boxes 解題者:蔡欣燁 解題日期: 2007 年 3 月 19 日.
:New Land ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11871: New Land 解題者:施博修 解題日期: 2011 年 6 月 8 日 題意:國王有一個懶兒子,為了勞動兒子,他想了一個 辦法,令他在某天早上開始走路,直到太陽下山前,靠.
: OPENING DOORS ? 題組: Problem Set Archive with Online Judge 題號: 10606: OPENING DOORS 解題者:侯沛彣 解題日期: 2006 年 6 月 11 日 題意: - 某間學校有 N 個學生,每個學生都有自己的衣物櫃.
: ShellSort ★★☆☆☆ 題組: Problem D 題號: 10152: ShellSort 解題者:林一帆 解題日期: 2006 年 4 月 10 日 題意:烏龜王國的烏龜總是一隻一隻疊在一起。唯一改變烏龜位置 的方法為:一隻烏龜爬出他原來的位置,然後往上爬到最上方。給 你一堆烏龜原來排列的順序,以及我們想要的烏龜的排列順序,你.
:Quarter-Finals with Brazil!? No!!! ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11041: Quarter-Finals with Brazil!? No!!! 解題者:呂彥澂 解題日期:
JAVA 程式設計與資料結構 第十四章 Linked List. Introduction Linked List 的結構就是將物件排成一列, 有點像是 Array ,但是我們卻無法直接經 由 index 得到其中的物件 在 Linked List 中,每一個點我們稱之為 node ,第一個 node.
: The Playboy Chimp ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10611: The Playboy Chimp 解題者:蔡昇宇 解題日期: 2010 年 2 月 28 日 題意:給一已排序的數列 S( 升冪.
:Problem D: Bit-wise Sequence ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10232: Problem D: Bit-wise Sequence 解題者:李濟宇 解題日期: 2006 年 4 月 16.
: Fast and Easy Data Compressor ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10043: Fast and Easy Data Compressor 解題者:葉貫中 解題日期: 2007 年 3.
1 Netlibrary 電子書 Netlibrary 創始於 1998 年,是世界知名的電子書資 料庫,提供 450 多家出版社所出版近 100,962 ( 止)本的電子書,且以每月 2,000 本的 速度增加中。其中 80% 屬於學術性圖書,其餘 20% 一般圖書, 90% 以上為.
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
: Placing Lampposts ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10859: Placing Lampposts 解題者:陳志瑜 解題日期: 2011 年 5 月 10 日 題意:美化為 Dhaka City.
:Nuts for nuts..Nuts for nuts.. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 10944:Nuts for nuts.. 解題者:楊家豪 解題日期: 2006 年 2 月 題意: 給定兩個正整數 x,y.
從此處輸入帳號密碼登入到管理頁面. 點選進到檔案管理 點選「上傳檔案」上傳資料 點選瀏覽選擇電腦裡的檔案 可選擇公開或不公開 為平台上的資料夾 此處為檔案分類,可顯示在展示頁面上,若要參加 MY EG 競賽,做品一律上傳到 “ 98 MY EG Contest ” 點選此處確定上傳檔案.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 參 資料蒐集的方法.
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
: Where is the Marble? ★☆☆☆☆ 題組: VOLUME CIV 題號: Q Where is the Marble? 解題者:劉淑惠 解題日期: 2006 年 6 月 11 日 題意:有許多上面有號碼的彈珠,將彈珠上面的 號碼由小到大排列,找出某個號碼的第一顆彈珠.
2005/7 Linear system-1 The Linear Equation System and Eliminations.
SQL 進階查詢.
9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Using the Set Operators Assist. Prof. Pongpisit Wuttidittachotti, Ph.D. Faculty.
Visual C++重點複習.
電子書 ( Netlibrary ) 檢索說明 龍華科技大學圖書館. 檢索類型 檢索欄位與限制 在檢索中使用布林邏輯運算元 檢索結果 特殊檢索.
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
Objectives After completing this lesson, you should be able to do the following: Define subqueries Describe the types of problems that the subqueries.
SQL1-ch8 操作資料 (DML) 1. 題號  80 題: 47 、 67  140 題: 12 、 49 、 50 、 55 、 79 、 80 、 89 、
SQL1-ch5 顯示多個表格的資料. 題號  80 題: 34 、 57 、 71 、 72  140 題: 18 、 25 、 62 、 97 、 115 、 131.
SQL1-ch10 其他綱要物件. 題號  80 題: 5 、 9 、 18 、 32 、 38 、 41 、 44 、 54 、 77  140 題: 76 、 78 、 120 、 132.
15 Copyright © Oracle Corporation, All rights reserved. Using SET Operators.
Copyright © 2004, Oracle. All rights reserved. Using the Set Operators.
SQL1-ch1 使用SQL SELECT 敘述句擷取資料.
SQL1-ch3 使用單列函數自訂輸出. 考古題題號  80 題: 7 、 37  140 題: 30 、 43 、 52 、 84 、 86 、 127.
SQL2-ch4 群組相關資料以產生報表. 題號  80 題: 11 、 20 、 43 、 59 、 70 、 80  140 題: 14 、 88 、 113.
SQL1-ch4 群組函數與聚總資料. 題號  80 題: 33 、 39  140 題: 10 、 59 、 95 、 110.
SQL1-ch9 使用 DDL 建立與管理表格 1. 題號  80 題: 63 、 76  140 題: 6 、 24 、 44 、 71 、 77 、 92 2.
SQL2-ch3 操控大型資料集.
Presentation transcript:

SQL1-ch7 集合運算 1

題號  80 題: 50 、 55 、 62  140 題: 41 、 61 、 134 2

集合運算  聯集 (UNION)  UNION ALL :顯示重覆資料 3

集合運算  交集 (INTERSECT) 4

集合運算  差集 (MINUS) 5

Q55/80 View the Exhibit and examine the structure of the EMPLOYEES and DEPARTMENTS tables. Which SET operator would you use in the blank space in the following SQL statement to list the departments where all the employees have managers? SELECT department_id FROM departments SELECT department_id FROM employees WHERE manager_id IS NULL; 6

A. UNION B. MINUS C. INTERSECT D. UNION ALL 7 SELECT department_id FROM departments SELECT department_id FROM employees WHERE manager_id IS NULL; SELECT department_id FROM departments SELECT department_id FROM employees WHERE manager_id IS NULL;

Q62/80 Which SET operator should be used in the blank space in the following SQL statement to display the cities that have departments located in them? SELECT location_id, city FROM locations SELECT location_id, city FROM locations JOIN departments USING(location_id); A. UNION B. MINUS C. INTERSECT D. UNION ALL 8

排序  Order By 子句  只能出現在 SQL 語法句尾  接受第一個 Select 子句的欄位名、別名、位置與 表示法 9

Q50/80 Evaluate the following SQL statement, which two ORDER BY clauses can be used to sort the output of the above statement? (Choose two): SELECT department_id “DEPT_ID”, department_name, ‘b’ FROM departments WHERE department_id=90 UNION SELECT department_id, department_name DEPT_NAME, ‘a’ FROM departments WHERE department_id=10 10

A. ORDER BY 3; B. ORDER BY 'b'; C. ORDER BY DEPT_ID; D. ORDER BY DEPT_NAME; 11 SELECT department_id “DEPT_ID”, department_name, ‘b’ FROM departments WHERE department_id=90 UNION SELECT department_id, department_name DEPT_NAME, ‘a’ FROM departments WHERE department_id=10 SELECT department_id “DEPT_ID”, department_name, ‘b’ FROM departments WHERE department_id=90 UNION SELECT department_id, department_name DEPT_NAME, ‘a’ FROM departments WHERE department_id=10

排序 12

Q41/140 Evaluate the following SQL statement: SELECT 2 col1,'y' col2 FROM dual UNION SELECT 1,'x' FROM dual UNION SELECT 3, NULL FROM dual ORDER BY 2; Which statement is true regarding the output of the SQL statement? 13

A. It would execute and the order of the values in the first column would be 3, 2, 1. B. It would execute and the order of the values in the first column would be 1, 2, 3. C. It would not execute because the column alias name has not been used in the ORDER BY clause. D. It would not execute because the number 2 in the ORDER BY clause would conflict with the value 2 in the first SELECT statement. 14

Q61/140 View the Exhibit and examine the structure in the EMPLOYEES tables. Evaluate the following SQL statement: SELECT employee_id, department_id FROM employees WHERE department_id= 50 ORDER BY department_id UNION SELECT employee_id, department_id FROM employees WHERE department_id= 90 UNION SELECT employee_id, department_id FROM employees WHERE department_id= 10; 集合運算中若有 order by 必須放在語法最後面 15

What would be the outcome of the above SQL statement? A. The statement would execute successfully and display all the rows in the ascending order of DEPARTMENT_ID. B. The statement would execute successfully but it will ignore the ORDER BY clause and display the rows in random order. C. The statement would not execute because the positional notation instead of the column name should be used with the ORDER BY clause. D. The statement would not execute because the ORDER BY clause should appear only at the end of the SQL statement, that is, in the last SELECT statement. 16

Q134/140 View the Exhibit and examine the structure of the EMPLOYEES and JOB_HISTORY tables. The query should display the employee IDs of all the employees who have held the job SA_MAN at any time during their tenure. Choose the correct SET operators to fill in the blank space and complete the following query. (Choose all that apply.) SELECT employee_id FROM employees WHERE job_id = 'SA_MAN' ____________ SELECT employee_id FROM job_history WHERE job_id='SA_MAN'; 17

A. UNION B. MINUS C. INTERSECT D. UNION ALL SELECT employee_id FROM employees WHERE job_id = 'SA_MAN' ____________ SELECT employee_id FROM job_history WHERE job_id='SA_MAN'; 18