Question

Write a command in sqlplus to find how long each employee has worked for the company....

Write a command in sqlplus to find how long each employee has worked for the company. The answer can be given in fractions of years.

Homework Answers

Answer #1

Let Employee be a table containing the fields employee_id, employee_name, employee_hiredate where employee_id and varchar_name is of varchar type and hiredate is of date type.

SQL command to find how long each employee has worked for the company :

select employee_id, employee_name, round((months_between(trunc(sysdate), trunc(hiredate))/12),2) years from Employee;

where sysdate returns the the current date and months_between returns the the number of months between sysdate and hiredate. The result is divided by 12 to return the number of years. round method rounds the difference to 2 digits after decimal point.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
How can a company record pension liabilities when it doesn’t know how much an employee will...
How can a company record pension liabilities when it doesn’t know how much an employee will receive or how long an employee will draw the pension
Vaughan company has 1 employee who worked 40 hours in the first week of the year....
Vaughan company has 1 employee who worked 40 hours in the first week of the year. Susie, the employee, makes $10 per hour. Assume that federal taxes are withheld at 10%, state tax at 8%, and FICA social security taxes are 6.2% and Medicare is taxed at 1.45%. Further assume that FUTA is taxed at 0.8% and SUTA at 5.4% up to the first $7,000 of wages. Insurance premiums are $80 per week. Vaughan pays 70% and Susie pays 30%...
(a) In an insurance company the average number of sick leaves for an employee is 0.5...
(a) In an insurance company the average number of sick leaves for an employee is 0.5 per month. The numbers of sick leaves in different months are independent. Under appropriate assumptions about the distribution, find the probability that the number of sick leaves for an employee is at least four days in a year. Write down and justify your assumptions. (b) An insurance company has three different types of employees, with 100 people of each type. Find the probability that...
Swan Company has a direct labor standard of 15 hours per unit of output. Each employee...
Swan Company has a direct labor standard of 15 hours per unit of output. Each employee has a standard wage rate of $14 per hour. During March, employees worked 13,100 hours. The direct labor rate variance was $9,170 favorable, and the direct labor efficiency variance was $15,400 unfavorable. How many units were produced? 655 units 1,100 units 800 units 873 units
Suppose you were recently promoted to a supervisory job in a company where you worked for...
Suppose you were recently promoted to a supervisory job in a company where you worked for two years. You genuinely like almost all your coworkers, who now report to you. The only exception is one employee, who dresses more formally than the others and frequently tells jokes that embarrass you and the other workers. Given your pre-existing feelings for the employees, how can you measure their performance fairly and effectively?
Swan Company has a direct labor standard of 35 hours per unit of output. Each employee...
Swan Company has a direct labor standard of 35 hours per unit of output. Each employee has a standard wage rate of $34 per hour. During March, employees worked 15,100 hours. The direct labor rate variance was $11,170 favorable, and the direct labor efficiency variance was $17,400 unfavorable. What was the actual labor costs? $502,230 $524,570 $513,400 $496,000
A company of 20 employees wants to find the employee who made the highest commission so...
A company of 20 employees wants to find the employee who made the highest commission so he/she can be paid a 10% bonus of the commission he/she earned for that month. The commission an employee makes is calculated by multiplying the sales amount by the commission rate. The commission rates are shown below: Sales Amount Commission Less Than 40000 No commission 40000 to 80000 inclusive 5% Greater than 80000 10% Write a program to: Prompt the user for each employee’s...
A company has ve employees on its health insurance plan. Each year, each employee independently has...
A company has ve employees on its health insurance plan. Each year, each employee independently has an 80% probability of no hospital admissions. If an employee requires one or more hospital admissions, the number of ad- missions is modeled by a geometric distribution with a mean of 1.50. The numbers of hospital admissions of different employees are mutually indepen- dent. Each hospital admission costs 20,000. Calculate the probability that the company's total hospital costs in a year are less than...
Write recursive method to return true if a given array has element equal to employee emp,...
Write recursive method to return true if a given array has element equal to employee emp, or returns false otherwise. Array can be empty or not. //PRECONDITION: Varible n denotes the number of occupied positions in the array and must be non-negative. Employee class has method getSalary() that returns employee's salary, // and it has method boolean equals(Employee emp) that accept an employee object and returns true if employee calling the equals method is equal as employee emp, and returns...
How can employee discrimination affect a company
How can employee discrimination affect a company
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT