sql function related question! Hi, I need to create a function that accepts officer_id and returns the keyword Active or Inactive. If officer_id exists in the system it finds the status of either A or I. (nested if) if the officer is active(a) then based on the last digit of badge number, if last digit is between 0-5 it returns 'ACTIVE ON DESK'. else if the last digit of badge number is greater than 5, it returns 'ACTIVE ON DUTY' If officer is inactive(I ), it returns Inactive. If officer_id does not exist, it returns 'not existing officer' Please help me with this!
sql function related question! Hi, I need to create a function that accepts officer_id and returns the keyword Active or Inactive. If officer_id exists in the system it finds the status of either A or I. (nested if) if the officer is active(a) then based on the last digit of badge number, if last digit is between 0-5 it returns 'ACTIVE ON DESK'. else if the last digit of badge number is greater than 5, it returns 'ACTIVE ON DUTY' If officer is inactive(I ), it returns Inactive. If officer_id does not exist, it returns 'not existing officer' Please help me with this!
Related questions
Question
sql function related question!
Hi, I need to create a function that accepts officer_id and returns the keyword Active or Inactive.
If officer_id exists in the system it finds the status of either A or I.
(nested if) if the officer is active(a) then based on the last digit of badge number, if last digit is between 0-5 it returns 'ACTIVE ON DESK'. else if the last digit of badge number is greater than 5, it returns 'ACTIVE ON DUTY'
If officer is inactive(I ), it returns Inactive.
If officer_id does not exist, it returns 'not existing officer'
Please help me with this!
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 1 images
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
Hi thank you for the explanation!
BTW, can you use oracle sql structure? Not MySQL.
It's a bit hard to understand
Solution
by Bartleby Expert
Similar questions