adplus-dvertising
frame-decoration

Question

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 .

a.

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);

b.

SELECT DISTINCT course_id
FROM instructor
WHERE name NOT IN (’Fall’, ’Spring’);

c.

(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010)

d.

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);

Posted under DBMS

Answer: (a).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);

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. 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 .

Similar Questions

Discover Related MCQs

Q. The phrase “greater than at least one” is represented in SQL by _____

Q. Which of the following is used to find all courses taught in both the Fall 2009 semester and in the Spring 2010 semester .

Q. SQL applies predicates in the _______ clause after groups have been formed, so aggregate functions may be used.

Q. Aggregate functions can be used in the select list or the_______clause of a select statement or subquery. They cannot be used in a ______ clause.

Q. The ________ keyword is used to access attributes of preceding tables or subqueries in the from clause.

Q. Which of the following creates temporary relation for the query on which it is defined ?

Q. Subqueries cannot:

Q. Which of the following is not a aggregate function ?

Q. A Delete command operates on ______ relation.

Q. Delete from r where P;
The above command

Q. Which one of the following deletes all the entries but keeps the structure of the relation .

Q. Which of the following is used to insert a tuple from another relation.

Q. Which of the following deletes all tuples in the instructor relation for those instructors associated with a department located in the Watson building which is in department relation.

Q. UPDATE instructor
_____ salary= salary * 1.05;

Fill in with correct keyword to update the instructor relation.

Q. _________ are useful in SQL update statements,where they can be used in the set clause.

Q. The problem of ordering the update in multiple update is avoided using

Q. Which of the following is the correct format for case statements.

Q. Which of the following relation updates all instructors with salary over $100,000 receive a 3 percent raise, whereas all others receive a 5 percent raise.

Q. SELECT *
FROM student JOIN takes USING (ID);

The above query is equivalent to

Q. In SQL the statement select * from R, S is equivalent to