ISQL Lab 7
October 26, 1999
Start a scripting session and answer the following questions. Then mail your script to jlaker@udel.edu with "ISQL Lab 7" as the subject.
Use the pubs2 database and subqueries.
1> select type, title, price from titles group by type
2> having price=max(price)
1> select distinct pub_name, type from publishers p, titles t
2> where p.pub_id = t.pub_id and
3> type != 'business'
1> select title Title, price Price, price*1.1 Increase, total_sales
from titles where total_sales>5000
4> select au_lname, state
5> from authors
6> order by upper(au_lname), state
select (au_fname + ' ' + au_lname + ', ' + phone) as Phone_List
from authors
update cars set color = 'maroon' where color = 'blue'
Other Commands
Dumping Log Files
If you encounter an error stating that you are out of space, this is probably due to your log files getting too big for you space allocation. To remedy this you need to "dump" your log file. The command for doing so is as follows.
dump tran dbname with truncate_only
go
IMPORTANT: Substitute dbname with your username since your username is the same as your database name.
Granting Permissions
The following is the command for granting permission to create tables in your database. grant create table to public or [comma delimited list of users]
go