请按照下文要求利用MySQL写出代码:The Daabase Developer at GlobalToyzrecieves requests for the folowing queriesfrequentlySELECT corderNo dorderdate scshopperIdvFirstName mTotalCostFROM Shopper ASs Orders AS aWHERE s
.
-- Create a view for the first query CREATE VIEW high_cost_orders AS SELECT corderNo, dorderdate, s.cshopperId, vFirstName, mTotalCost FROM Shopper AS s, Orders AS a WHERE s.cShopperId=a.cShopperId AND mTotalCost>80;
-- Create a view for the second query CREATE VIEW toy_categories AS SELECT cToyId, vToyName, category FROM Toys AS t, Category AS c WHERE t.cCategoryId=c.cCategoryId;
-- Create a view for the third query CREATE VIEW toy_brands AS SELECT cToyId, VToyName, cBrandName FROM Toys AS t, ToyBrand AS tb WHERE t.cBrandId=tb.cBrandId;
-- Now the Database Developer can simply execute the following queries SELECT * FROM high_cost_orders; SELECT * FROM toy_categories; SELECT * FROM toy_brands
原文地址: https://www.cveoy.top/t/topic/fztv 著作权归作者所有。请勿转载和采集!