I am writing a SQL quray I really need help with this one Q
I am writing a SQL quray. I really need help with this one.
Q. Solmaris charges $70 for the first hour and $30 for all following hours based on the estimated hours for every service request. List the condo ID, description, and service charge for every service request.
Solution
To find service charge you can use CASE statement in SELECT Query.
SELECT condo ID
              ,description
               ,CASE WHEN HOUR = 1 THEN 70
                           ELSE (70 + 30(HOUR - 1))
                END AS service charge
 FROM TABLE_NAME  

