Question: Following is the relational schema, write expressions of SQL query to answer the following. Relational schema of question 1. Product(model, maker, type) PC(model, speed, ram,
Following is the relational schema, write expressions of SQL query to answer the following.
Relational schema of question
1. Product(model, maker, type)
PC(model, speed, ram, hd, price)
Laptop(model, speed, ram, hd, screen, price)
Printer(model, color, type, price)
List the names and models of the manufacturers who make PCs and laptops with speeds greater than 2.
Solutions:
1. Select pr.model, pr.maker FROM Product as pr INNER JOIN PC as pc ON pr.model = pc.model INNER JOIN Laptop as lp ON pr.model = lp.model Where (pr.type = 'PC' OR pr.type = 'Laptop' ) AND pc.speed > '2' AND lp.speed > '2';
2. SELECT a.maker from Product a left join PC b on a.model=b.model join Laptop c on a.model=c.model where c.speed>2 or b.speed>2;
Both these are not working solutions. Could anyone correct or find a correct solution? You can use "http://dbis-uibk.github.io/relax/calc.htm" and select Database Systems The Complete Book - Exercise 2.4.1 from dropdown to verify the solution and then post the answer.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
