Homework 3
CS122, Spring 2004


Due: Tuesday, May 4

Please send the solutions to csun@calstatela.edu by email. Make sure to use CS122 Spring 04 HW3 as the subject of the email, and include in the email your name so I don't have to guess names from email addresses.


0. Read Chapter 5 of the textbook except the section about DISTINCTROW, and read Chapter 9 of the textbook up to the Function of Functions section.

Use Books.mdb for the following problems [Abbott]:

1. (5pt) List the book categories and the average number of pages in the books in each category.

2. (5pt) List the book categories and the average number of pages in the books in each category, excluding the categories where the average number of pages is less than 200.

3. (5pt) List the book categories and the average number of pages in the books in each category, excluding the categories where the average book price is less than $20.

4. (5pt) List the titles ordered by the length of the title. If two titles have the same length, order them alphabetically.

5. (5pt) List summer readings, e.g. titles that were published in July or August.

6. (5pt) List the books published in the last 4 years. Note that your query should remain correct in the future, which means the number 2004 should not appear anywhere in the query.

7. (5pt) List the author names in the form <first initial>, period, space, <last name>, e.g. C. Sun. Order the results first by last name, then first name. Do not list authors who do not have both a first name and a last name in the database.