資料庫兩題 - 考試
By Jake
at 2013-06-11T03:37
at 2013-06-11T03:37
Table of Contents
某年雲科大資管所考題
1. A SQL SELECT statement contains a nested query in the WHERE clause,comparing
the value of an attribute to the values returned by the nested SELECT with an
IN predicate. Which of the following predicates can be used in that statement
instead of IN?
(A)=SOME (B)=ALL
(C)=ANY (D)=EVERY
答案是C
查了一下用法IN=ANY=SOME
所以不選SOME的理由是 還是答案其實可以選
2. Two tables are given: STUDENT(StudNO,Name,Department) and GRADES(StudNo,
Course,Grade). Which of the given SQL statements will retrieve the names
of
students who got an A in each course they passed?
(A) SELECT name
FROM student
WHERE NOT EXISTS(SELECT *
FROM grades
WHERE grade IN('B','C')and
student.studno=grades.studno);
(B) SELECT name
FROM student JOIN grades ON student.studno=grades.studno
WHERE grade='A';
(C) SELECT name
FROM student,grades
WHERE grade='A'and student.studno=grades.studno;
(D) SELECT name
FROM student
WHERE 'A'=ALL(SELECT grade
FROM grades
WHERE student.studno=grades.studno);
已知題目沒有提到等第有哪些 所以不考慮A
由於grades的屬性沒有name 所以C也不考慮
B跟D不知道差在哪 答案是D 可是不知道B錯在哪
--
1. A SQL SELECT statement contains a nested query in the WHERE clause,comparing
the value of an attribute to the values returned by the nested SELECT with an
IN predicate. Which of the following predicates can be used in that statement
instead of IN?
(A)=SOME (B)=ALL
(C)=ANY (D)=EVERY
答案是C
查了一下用法IN=ANY=SOME
所以不選SOME的理由是 還是答案其實可以選
2. Two tables are given: STUDENT(StudNO,Name,Department) and GRADES(StudNo,
Course,Grade). Which of the given SQL statements will retrieve the names
of
students who got an A in each course they passed?
(A) SELECT name
FROM student
WHERE NOT EXISTS(SELECT *
FROM grades
WHERE grade IN('B','C')and
student.studno=grades.studno);
(B) SELECT name
FROM student JOIN grades ON student.studno=grades.studno
WHERE grade='A';
(C) SELECT name
FROM student,grades
WHERE grade='A'and student.studno=grades.studno;
(D) SELECT name
FROM student
WHERE 'A'=ALL(SELECT grade
FROM grades
WHERE student.studno=grades.studno);
已知題目沒有提到等第有哪些 所以不考慮A
由於grades的屬性沒有name 所以C也不考慮
B跟D不知道差在哪 答案是D 可是不知道B錯在哪
--
Tags:
考試
All Comments
By Lauren
at 2013-06-13T08:37
at 2013-06-13T08:37
Related Posts
行政學的問題
By Hamiltion
at 2013-06-11T00:52
at 2013-06-11T00:52
補習班准考證價
By Robert
at 2013-06-11T00:21
at 2013-06-11T00:21
電機機械-同步發電機
By Ida
at 2013-06-11T00:03
at 2013-06-11T00:03
資訊類 101年警察人員考試 資料庫問題
By Hedy
at 2013-06-10T22:33
at 2013-06-10T22:33
兌換券分錄
By Oliver
at 2013-06-10T22:32
at 2013-06-10T22:32