Part 1: Write expressions of relational algebra to answer the following queries, draw expression trees. and show the result of each query.
- Find all PC models that have speeds of at least 2.10.
- Which manufacturers make laptops with a hard disk of at least 250 GB?
- Find the model number and price of all products made by co-c.
- Find the model number of color printers.
- Find the manufacturers that sell PCs but not laptops.
- Find the hard-disk size used in two or more PCs.
- Find the pairs of PC models that have both the same speed and memory. A pair should be listed only once.
- Find the manufacturers of at least two different computers (PCs or laptops) with speeds of at least 2.0.
- Find the manufacturers of PCs with at least three different speeds.
- Find manufacturers who sell exactly three different models of PC.
Part 2: Suppose relations R and S have n and m tuples, respectively. Give the minimum and maximum number of tuples that the results of the following expressions can have.
( )× , for some condition C( )− , for some list of attributes L
Part 3: Consider the relations at the beginning of this assignment and define the following constraints about the relations. NOTE: You saw in the course that you can write your constraints by equating the expression to the empty set. It means that no values should return from the expression or the result would be an empty set as
- A PC with a processor speed less than 2.0 must not sell for more than $1000.
- A laptop with a screen size less than 15.4 inches must have at least a 500-gigabyte hard disk or sell for less than $1000.
- No manufacturer of PCs may also make laptops.
- If a laptop has a greater main memory than a PC, then the laptop must have a higher price than a PC.


0 comments