cs186_fa07_mt1_sol 4 - SELECT b.title, s.edition FROM book...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
c) [5 points] The fol owing SQL query is given: SELECT b.title, s.edition FROM book b, in_stock s WHERE b.isbn = s.isbn and s.lib_name = 'Cao Library' and NOT EXISTS (SELECT * FROM in_stock i WHERE i.lib_name = 'Evans Library' and i.quantity > s.quantity ); Which of the fol owing queries wil produce a different result set? i) SELECT b.title, s.edition FROM book b, in_stock s WHERE b.isbn = s.isbn and s.lib_name = 'Cao Library' and s.quantity NOT IN (SELECT distinct quantity FROM in_stock i WHERE i.lib_name = 'Evans Library'); i )
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SELECT b.title, s.edition FROM book b, in_stock s WHERE b.isbn = s.isbn and s.lib_name = 'Cao Library' and s.quantity > (SELECT MAX(quantity) FROM in_stock i WHERE i.lib_name = 'Evans Library'); i i) SELECT b.title, s.edition FROM book b, in_stock s WHERE b.isbn = s.isbn and s.lib_name = 'Cao Library' and s.quantity > ALL (SELECT quantity FROM in_stock i WHERE i.lib_name = 'Evans Library'); iv) None of the above. i : 5/5 i,i ,i i: 1.75/5 i,i or i,i i: 3.25/5 i : 1.75/5 i i: 1.75/5 Your answer: i...
View Full Document

This note was uploaded on 08/30/2009 for the course CS 186 taught by Professor Staff during the Fall '08 term at University of California, Berkeley.

Ask a homework question - tutors are online