These problems give you a chance to practice using the relational algebra operators you learned about in Weeks 7 and 8 to construct queries that implements a natural language task. They do not ask for SQL queries.
For each problem:
- Write a relational algebra query to find the answer.
- Draw an expression tree of the sort you read about in Online Session 7 for the query.
- Show the result of your query for the instances given at the bottom of this page.
Create a single PDF file named homework04.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.
This database stores information about computer manufacturers and their products. It consists of four relations, with these schema:
Product(maker, model, type) PC(model, speed, ram, hd, price) Laptop(model, speed, ram, hd, screen, price) Printer(model, color, type, price)
The Product relation consists of the manufacturer, a model number, and a type ("PC", "laptop", "printer"). Model numbers are unique across all manufacturers and all products.
The PC relation consists of a model number, the speed of the processor in gigahertz, the size of the RAM in megabytes, the size of the hard disk in gigabytes, and the price.
The Laptop relation is similar to the PC relation, with the addition of screen size in inches.
The Printer relation includes a model number, whether it produces color (true or false), a type ("laser", "inkjet"), and the price.
This file, homework04-product.txt, contains instances of each relation. Use this data to show the results of your queries.
By the due time and date, submit your homework04.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.