Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You were asked to review the following code: PROC SQL; SELECT MEDICATION, PETID, COST, COST * . 0 7 5 AS TOTAL _ COST FORMAT

You were asked to review the following code:
PROC SQL;
SELECT MEDICATION, PETID, COST, COST *.075 AS
TOTAL_COST FORMAT DOLLAR10.2,
CASE
WHEN TOTAL_COST <50 THEN 'Low Cost Med'
WHEN TOTAL_COST <100 THEN 'Average Cost Med'
WHEN TOTAL_COST <200 THEN 'High Cost Med'
WHEN TOTAL_COST >=200 THEN 'Extremely High Cost Med'
ELSE 'No Cost Med or Unknown Med Cost'
END AS MED_COST_CATEGORY
FROM WORK.PETMEDS;
Based on what has been provided, what is your assessment of this code?
Question 6 options:
A)
The code is correct as written and will run properly
B)
There is an error in the Case expression so the code will not run properly
C)
There is an error because there should not be a comma before the Case expression begins
D)
The query creates a new field named TOTAL_COST
E)
If the value of TOTAL_COST is 0, the results of the query will be "No Cost Med or Unknown Med Cost"
F)
A & C are correct

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions