All aggregate functions except ignore null values in their input collection a

All aggregate functions except ignore null values in

This preview shows page 45 - 52 out of 82 pages.

4. All aggregate functions except _____ ignore null values in their input collection. a) Count(attribute)b) Count(*)c) Avgd) Sum View Answer
Image of page 45
Answer: bExplanation: * is used to select all values including null. 5. A Boolean data type that can take values true, false, and________ View Answer 6. The ____ connective tests for set membership, where the set is a collection of values produced by a select clause. The ____ connective tests for the absence of set membership. View Answer
Image of page 46
7. Which of the following should be used to find all the courses taught in the Fall 2009 semester but not in the Spring 2010 semester . SELECT DISTINCT course id FROM SECTION WHERE semester = ’Fall’ AND YEAR= 2009 AND course id NOT IN (SELECT course id FROM SECTION WHERE semester = ’Spring’ AND YEAR= 2010); SELECT DISTINCT course_id FROM instructor WHERE name NOT IN (’Fall’, ’Spring’); (SELECT course id FROM SECTION WHERE semester = ’Spring’ AND YEAR= 2010)
Image of page 47
advertisement SELECT COUNT (DISTINCT ID) FROM takes WHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id, semester, YEAR FROM teaches WHERE teaches.ID= 10101); View Answer 8. The phrase “greater than at least one” is represented in SQL by _____ a) < allb) < somec) > alld) > some View Answer
Image of page 48
Answer: dExplanation: >some takes atlest one value above it . 9. Which of the following is used to find all courses taught in both the Fall 2009 semester and in the Spring 2010 semester . SELECT course id FROM SECTION AS S WHERE semester = ’Fall’ AND YEAR= 2009 AND EXISTS (SELECT * FROM SECTION AS T WHERE semester = ’Spring’ AND YEAR= 2010 AND S.course id= T.course id); SELECT name FROM instructor WHERE salary > SOME (SELECT salary FROM instructor WHERE dept name = ’Biology’);
Image of page 49
(SELECT course id FROM SECTION WHERE semester = ’Spring’ AND YEAR= 2010) View Answer 10. We can test for the nonexistence of tuples in a subquery by using the _____ construct.
Image of page 50
Database Questions and Answers – Modification of Database This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Modification of Database”.
Image of page 51
Image of page 52

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture