7. Which two statements are true regarding the USING and ON clauses in table joins? (Choose two.)
A. Both USING and ON clauses can be used for equijoins and nonequijoins.
B. A maximum of one pair of columns can be joined between two tables using the ON clause.
C. The ON clause can be used to join tables on columns that have different names but compatible data types.
D. The WHERE clause can be used to apply additional conditions in SELECT statements containing the ON or the USING clause.
Answer: CD
題目解析:
A: Using和On子句都可以用於等式和不等式串連(錯誤,Using只能用於等式串連)
B:在兩個表之間使用On子句最大隻能串連兩個欄位(錯誤,可以串連多個欄位,如,on e.empno=d.empno and e.deptno=d.deptno)
C:On子句可以串連兩個表中名稱不同的欄位,但資料類型要相容(正確,On子句可以串連不同的欄位名,Using只能用於相同的欄位名)
D: 在包含On和Using子句的Select語句中,可以使用Where語句作為附加的條件(正確,例如:
SELECT e.department_id, d.department_idFROM employees e JOIN departments d ON (e.department_id = d.department_id) Where e.department_id>20;