## Homework Assignment 3

### Relational Algebra

#### Introduction

The Problems
All the problems on this assignment ask for a relational algebra expression that implements a natural language query. (They do not ask for SQL queries.) They give you a chance to use all of the relational operators you learned about in Week 7.

The problems are listed roughly in order of difficulty. I hope that everyone in the class is able to figure out Problems 1-7 without too much work. Problems 8 and 9 are a bit more challenging, and Problem 10 may seem even tougher. Give the last three a shot even if you don't think you've found an answer. They will make you think about what the relational operators can do for you.
The Deliverable
Create a single PDF file named homework03.pdf that contains the text of all of your solutions. You may want to use Word or some editor that supports subscripts and the lowercase Greek letters you need for the relational operators.

#### The Database

Refer to the relations in this database when constructing your relational algebra expressions:

```Movie                                    ||   Actor
||
title           director  year  rating   ||   actor      yearBorn
---------------  -------  ----  ------   ||   ---------  --------
Fargo            Coen     1996     8.2   ||   Cage       1964
Raising Arizona  Coen     1987     7.6   ||   Hanks      1956
Spiderman        Raimi    2002     7.4   ||   Maguire    1975
Wonder Boys      Hanson   2000     7.6   ||   McDormand  1957

StarsIn                                  ||   Director
||
actor      movie                         ||   director    yearBorn
---------  --------                      ||   ---------   --------
Cage       Raising Arizona               ||   Coen        1954
Maguire    Spiderman                     ||   Hanson      1945
Maguire    Wonder Boys                   ||   Raimi       1959
McDormand  Fargo                         ||
McDormand  Raising Arizona               ||
McDormand  Wonder Boys                   ||
```

#### Problems

1. Find all actors.

2. Find all movies and their ratings.

3. What movies were made after 1997?

4. What movies did Hanson make after 1997?

5. Find all actors and directors.

6. Which Coen movies feature McDormand?

7. Which movies feature Maguire but not McDormand?

8. Find actor/director pairs where the director is younger than the actor.

9. Which movies were made by a director younger than 40 years old?

10. Which actors have appeared in a Coen movie?

#### Deliverables

By the due time and date, submit your homework03.pdf file using the electronic submission system.

Be sure to use the name specified for the file you submit! This enables an autograder to find and process your submission.

If you need help or have any any questions, please ask promptly.

Eugene Wallingford ..... wallingf@cs.uni.edu ..... October 2, 2020