Good day everyone. I am a newbie in this forum and in SQL. Just started learning. So i have some exam sample questions here? Is it ok if i post the questions and give my answers and u guys help to verify if it is right? Here we go.
SUPPLIER(Supp_ID , Supp_Name, CITY)
PARTS(Part_Num, Part_Name, Colour)
PROJECT(Project_Num, Project_Name, City)
QUANTITY(Supp_ID, Part_Num, Project_Num, Qty)
Explain the following SQL query statement.
SELECT Supp_Name FROM SUPPLIER WHERE CITY= 'Alor Star'
My answer= the statement states that the supplier name will be obtained from the supplier field where the the supplier is from Alor Star.
Select Part_Num, Project_Num, AVG(Qty)
WHERE Project_Num ='PJT007'
GROUP BY Part_Num
My answer=the statement states that the part number, project number, average of the quantity will be selected from the quantity field. It will then specify by choosing it from project Num of PJT007. Lastly, it will group it according to the part number.
Write an SQL statement to find name of suppliers who supply parts to projects in the city which they are based.
SELECT Supp_Name, Part_Name, Project_Name, City
FROM Supplier, Parts , Project
Is it correct or there are ammendments. If so, pls help. I have no where to ask for help. Tq.