4. All aggregate functions except _____ ignore null values in their input collection.a) Count(attribute)b) Count(*)c) Avgd) SumView Answer
Answer: bExplanation: * is used to select all values including null.5. A Boolean data type that can take values true, false, and________View Answer6. 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
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 idFROM SECTIONWHERE semester = ’Fall’ AND YEAR= 2009 ANDcourse id NOT IN (SELECT course idFROM SECTIONWHERE semester = ’Spring’ AND YEAR= 2010);SELECT DISTINCT course_idFROM instructorWHERE name NOT IN (’Fall’, ’Spring’);(SELECT course idFROM SECTIONWHERE semester = ’Spring’ AND YEAR= 2010)
advertisementSELECT COUNT (DISTINCT ID)FROM takesWHERE (course id, sec id, semester, YEAR) IN (SELECT course id, sec id, semester, YEARFROM teachesWHERE teaches.ID= 10101);View Answer8. The phrase “greater than at least one” is represented in SQL by _____a) < allb) < somec) > alld) > someView Answer
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 idFROM SECTION AS SWHERE semester = ’Fall’ AND YEAR= 2009 ANDEXISTS (SELECT *FROM SECTION AS TWHERE semester = ’Spring’ AND YEAR= 2010 ANDS.course id= T.course id);SELECT nameFROM instructorWHERE salary > SOME (SELECT salaryFROM instructorWHERE dept name = ’Biology’);
(SELECT course idFROM SECTIONWHERE semester = ’Spring’ AND YEAR= 2010)View Answer10. We can test for the nonexistence of tuples in a subquery by using the _____ construct.
Database Questions and Answers – Modification of DatabaseThis set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Modification of Database”.