Homework 4
CS122, Spring 2004


Due: Thursday, May 27

Please send the solutions to csun@calstatela.edu by email. Make sure to use CS122 Spring 04 HW4 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 3 and Chapter 7 of the textbook.

1.(5pt) Continue with the last problem of Lab 7 and verify the second part of De Morgan's Law: the complement set of A intersection B is the union of A's complement set and B's complement set.

Use Books.mdb for the following problems:

2. Update queries

(a) (5pt) Use CREATE TABLE statement to create a table authors2 which has exactly the same fields as the authors table.

(b) (2pt) Use INSERT INTO ... SELECT to populate authors2 with the content of the authors table.

(c) (5pt) We finally found out that the missing first name of Kellsey is "Buttford". Write a query to update the information in authors2. Note that there might be more than one author with the last name Kellsey.

(d) (2pt) Add a new column email to authors2.

(e) (8pt) The email of an author is in the form: first letter of first name in lower case, last name in lower case, @hotmail.com. e.g. Sarah Buckman's email address would be sbuckman@hotmail.com. Write a query to fill in the email information in authors2.

(f) (8pt)  The area code 415 in San Francisco has changed to 475. Write a query to update the information in authors2. You may assume that the phone numbers are in the form ###-###-####, where the first 3 digits are the area code.

3. (5pt) Find the name(s) of the publisher(s) that have not published any book.

4. (5pt) List the author name and the total number of pages in books written by each author. [Abbott]

5. (5pt) Find the name(s) of the author(s) who wrote the greatest number of books. [Abbott]