Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions