Question: Relational Algebra Exercise Given database schemas: Product ( maker , model, type ) PC ( model , speed, ram, hd , price ) Laptop (

Relational Algebra Exercise
Given database schemas:
Product(maker, model, type)
PC(model, speed, ram, hd, price) Laptop(model, speed, ram, hd, screen, price) Printer(model, color, type, price)
Questions:
a) What PC models have a speed of at least 3.00?
R1=select (speed >=3.0)(PC) R2= project (model)(R1)
b) Which manufacturers make laptops with a hard disk of at least 100GB? R1= select (hd =>100)(laptop)
R2=natural_join (Product, R1) R3= project (make)(R2)
c) Find the model and price of all products (of any type) made by manufacturer B. R1= Project (model)(select (maker ='B')(Product))
R2= Project (model, price)(PC)
R3=Project (model, price)(laptop) R4= Project (model, price)(printer) R5= R2 U R3 U R4
R6= natural _join (R1, R5))
Exercise a
R1:=0speed >=30.0(PC)
R2:= model (R1)
Exercise b
R1:= Ond >=10(Laptop) R2:= Product DA (R1)
R3=: Mmaker (R2)
Exercise c
R1:=0maker=B (Product DA PC)
R2=: 0 maker=(Product 4 R3 :=0maker=(Product *
R4:= model, price (R1)
R5:= model, price (R2)
R6: = model, price (R3) R7:= R4 UR5 U R6
Laptop) Printer)
Exercise d
R1:= Ocolr =true AND ytpe =laser (Printer)
R2:= model (R1)
Exercise e
R1:= Otype=laptop (Product)
R2:=0type=Pc(Product) R3=: TmakerR1)
R4:= maker (R2) R5:= R3- R4
Exercise f
R1:= Ppc1(PC)
R3:= R1 DX (PC.hd =PC.hd AND PC1m. odel >< PC2.model) R2 R4 := n d (R3)
Exercise g
R1:= Ppc(PC)
R2:= Ppc2(PC)
R3:= R1/X (P1speed =PC2 sped AND PC1. amr =PC2ra.m ANDPC1. model

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!