Homework Assignment 4

More Relational Algebra


CS 3140
Database Systems
Fall Semester 2020


Due: Thursday, October 15, at 11:59 PM


Introduction

The Problems
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.
The Deliverable
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.


The Database

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.



Problems

  1. Which PC models have a speed of at least 3.00?

  2. Which manufacturers produce laptops with a hard disk of at least 100 GB?

  3. Find the model number and price of all products made by manufacturer "B".

  4. Find the model numbers of all laser printers.

  5. Which manufacturers make laptops but not PCs?

  6. Find the hard disk sizes that occur in two or more PCs.


Deliverables

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.



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