ISQL Lab 9
November 16, 1999
Start a scripting session and answer the following questions. Then mail your script to jlaker@udel.edu with "ISQL Lab 9" as the subject.
Use the pubs2 database and subqueries to answer these questions.
1> select type 'Type', title 'Title', max(price) 'Max Price'
2> from titles
3> group by type
4> having price = max(price)
OR
1> select type, title, price as maxprice from titles t1
2> where price = (select max(price) from titles t2
3> where t1.type = t2.type
4> group by t2.type)
1> select au_fname 'First Name', au_lname 'Last Name', city 'City'
2> from authors
3> where city in (select city
4> from authors
5> where au_lname = 'Stringer'
6> and au_fname = 'Dirk')
1> select pub_name 'Publisher', city 'City'
2> From publishers
3> where city in (select distinct city
4> from authors)
1> select distinct pub_name 'Publisher'
2> from publishers
3> where pub_id in (select distinct pub_id
4> from titles
5> where type = 'business')
1> select distinct pub_name 'Publisher'
2> from publishers
3> where pub_id not in (select distinct pub_id
4> from titles where type = 'business')