Question: SQL. AdventureWorks. Create a query calculating the profit margin of bike models (use Production.ProductCategory.Name to determine if the product is a bike.) Profit margin is

SQL. AdventureWorks. Create a query calculating the profit margin of bike models (use Production.ProductCategory.Name to determine if the product is a bike.) Profit margin is the difference between ListPrice and StandardCost divided by the ListPrice. Only consider bike models currently sold (Use DiscontinuedDate in Production.Product.) Your output should contain the following columns, with models exhibiting the greatest profit margins listed first. ProductModelID Product Name Profit Margin (expressed as a two-digit decimal. For example a 93% profit margin will be displayed as 0.93) (Look at using CAST or CONVERT to do this.) You will use the following tables: Production.Product Production.ProductSubCategory Production.ProductCategory

SQL. AdventureWorks. Create a query calculating the profit margin of bike models

ProductSubcategory (Production) ProductSubcategoryID ProductCategoryID Name rowguid Product Category (Production) ProductCategoryID Name rowguid ModifiedDate . 8 Product (Production) ProductID Name Product Number MakeFlag FinishedGoodsFlag Color SafetyStockLevel ReorderPoint Standard Cost List Price Size SizeUnit MeasureCode Weight Unit MeasureCode Weight Days To Manufacture ProductLine Class Style ProductSubcategoryID Product Modell SellStart Date SellEndDate Discontinued Date rowguid

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 Databases Questions!