Use above tables to answer questions below: Can you show through mysql please? G
ID: 3563011 • Letter: U
Question
Use above tables to answer questions below: Can you show through mysql please?
Given the query, "For parts that are supplied to some projects in average quantity of more than 350, show part numbers and part names." (Basically, you want to identify popular bulk parts; P4 is one of the answers but P1 is not.) Write a SQL statement. Define a view for "For parts that are supplied to some projects in average quantity' of more than 350, show part number" and rephrase (a) by using the view and show the result. Show how the systems catalog stores the view definition.Explanation / Answer
a)
SELECT SPJ.PNO,PART.PNAME
FROM SPJ
INNER JOIN PART
GROUPBY PNO
HAVING avg(QTY)>350
b)
CREATE VIEW POPULARPART
AS SELECT SPJ.PNO,PART.PNAME
FROM SPJ
INNER JOIN PART
GROUPBY PNO
HAVING avg(QTY)>350
c)
The system catalog simply stores the defination of the view
and no separate database is made.
whenever the view is accessed the data is derived from the base tables used in the view defination
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.