SQL Programming Lab 6
October 19, 1999
Start a scripting session and answer the following questions. Then mail your script to
jlaker@udel.edu with "ISQL Lab 6" as the subject.Use the pubs2 database.
1> SELECT au_fname First, au_lname Last
2> FROM authors
3> WHERE state IN ('TN', 'MN', 'IN')
4> go
First Last
-------------------- ----------------------------------------
Morningstar Greene
Michel DeFrance
1> SELECT title Title, type Type, price PresentPrice, (price+2) AdjPrice
2> FROM titles
3> WHERE type IN ('business', 'psychology')
1> SELECT state, count(state) FROM authors
2> GROUP BY state
3> go
state
----- -----------
CA 15
IN 1
KS 1
MD 1
MI 1
OR 1
TN 1
UT 2
1> SELECT title, title_id, total_sales
2> FROM titles
3> where totlal_sales between 4095 and 12000
1> SELECT title , title_id, FROM titles
2> WHERE total_sales IS NULL
sp_adduser username
go
Again, the username here is the username is the login of the user you are adding. Repeat this for each user in your group. They should now be able to access your database with the "use" command. Try it out.