You are working as a data analyst for MDFT Pro, a well-known training agency. The academy uses a Fabric warehouse to track their training course sales. The warehouse contains a table named Courses that stores information about their training courses. The table contains the following columns.
Name | Datatype | Nullable |
---|---|---|
CourselD | Integer | No |
CourseName | Decimal(18, 2) | No |
ListPrice | Decimal(18, 2) | No |
WholesalePrice | Decimal(18, 2) | Yes |
AgentPrice | Decimal(18, 2) | Yes |
Your manager has asked you to write a T-SQL query that will return the following columns to help analyze course pricing.
Name | Description |
---|---|
CourseID | Return the CourseID value |
HighestPrice | Returns the highest value from ListPrice, WholesalePrice and AgentPrice |
TradePrice | Returns AgentPrice if present, otherwise returns WholesalePrice if present, otherwise returns ListPrice |
You have the following T-SQL query:
SELECT
CourseID,
________________ (ListPrice, WholesalePrice, AgentPrice) AS HighestPrice
FROM Courses
How should you complete the query?
Choose the correct answer from the options below.
Explanations for each answer: