Question: SQL Functions A function is a piece of code stored in the database that allows you to perform a specific task that returns an output.

 SQL Functions A function is a piece of code stored in

SQL Functions A function is a piece of code stored in the database that allows you to perform a specific task that returns an output. There are a lot of functions built into Oracle SQL to perform a lot of different calculations or processes. Why would you want to use a function? Functions are used to perform manipulation on data, such as Count the number of records that meet a certain criterion, total a range of numbers, convert a date to another time zone, and find a specific character in a string of characters. Whenever you need to see more than just the value that's stored in the database table, you'll probably need to use a function. Question 4 Consider the table below and answer the questions that follow. Table 3: stafflist 4.1 Create a query to view each employee's wage as well as what it would be if you added 5000 to it. (5 Marks) 4.2 In September Andrew received 11764.658 because of some deductions from his wage. Implement CEILING and FLOOR functions on SQL developer to round the amount (11764.658) to a nearest whole number. (5 Marks) 4.3 Let the output from CEILING be ' y ' and output from FLOOR be ' x '. Is y>x ? Explain your answer. (5 Marks) 4.4 Assume you want to combine the name and salary value of an employee (Johnson) from the stafflist table (concatenation). Create SQL query to perform the operation. Keep a space between the name and wage. (5 Marks) 4.5 Assume you have been assigned the responsibility of extracting the last three characters from the Stafflist table's name field. Is it possible to run this query without utilizing the LENGTH function

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!